view · edit · sidebar · attach · print · history

20110421-testcases-oddb_org-model-composition_rb-util-interval_rb-view-patinfo_rb

<< | Index | >>


  1. Update testcases

Goal/Estimate/Evaluation
  • Testcases / 85% / 84.80%
Milestones
  • Update testcases
    1. src/model/composition.rb (coverage: 44.09%) 8:15
    2. src/util/interval.rb (coverage: 99.21%) 10:40
    3. src/view/drugs/patinfo.rb (coverage: 100%) 11:00
    4. src/view/user/export.rb (coverage: 44.00%)
    5. src/view/drugs/recentregs.rb (coverage: 41.13%)
Summary
Commits

Memo (closure, Proc, lambda, Method)

Reference

Note

  • Proc is used in src/util/interval.rb#filter_interval method
  • If Proc is used, the testcase becomes sometimes a little bit complicated
  • because a sort of new method is defined by Proc

Proc example

def test
  Proc.new do |arg|
    p arg
  end
end

test.call('123')
# => '123'

def test2
  Proc.new.call('456')
end

test2 do |arg|
 p arg
end
# => '456'

def test3
  yield('789')
end

test3 do |arg|
  p arg
end
# => '789'
view · edit · sidebar · attach · print · history
Page last modified on April 26, 2011, at 07:56 AM