Class: ODDB::MedDataTest

Inherits:
Test::Unit::TestCase
  • Object
show all
Includes:
FlexMock::TestCase
Defined in:
ext/meddata/test/test_meddata.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) test__dispatch

def test__dispatch__block

      session = flexmock('Session')
      input = [
        ['ctl1', {:name => 'Meier'}],
        ['ctl2', {:name => 'Müller'}],
        ['ctl3', {:name => 'Huber'}],
        ['ctl4', {:name => 'Klaus'}],
      ]
      result = MedData._dispatch(session, input) { |res|
        assert_instance_of(MedData::Result, res)
      }
      assert_nil(result)
    end
    def test__dispatch__no_block
      session = flexmock('Session')
      input = [
        ['ctl1', {:name => 'Meier'}],
        ['ctl2', {:name => 'Müller'}],
        ['ctl3', {:name => 'Huber'}],
        ['ctl4', {:name => 'Klaus'}],
      ]
      results = MedData._dispatch(session, input)
      results.each { |result|
        assert_instance_of(MedData::Result, result)
      }
    end


44
45
46
47
48
49
# File 'ext/meddata/test/test_meddata.rb', line 44

def test__dispatch
  str = MedData::Result
  instance = str.new('bar', 'baz')
  assert_equal('bar', instance.values)
  assert_equal('baz', instance.ctl)
end