Class: TestMedwinPackagePlugin

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
test/test_plugin/medwin.rb

Defined Under Namespace

Classes: StubApp, StubPackage, StubSequence, StubSession

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



187
188
189
190
191
192
193
194
# File 'test/test_plugin/medwin.rb', line 187

def setup
  @app = StubApp.new
  @plugin = ODDB::MedwinPackagePlugin.new(@app)
  @plugin.session = StubSession.new
  target = File.expand_path('../../test/data/html/medwin', File.dirname(__FILE__))
  table = 'medwin_package.html'
  @html = File.read([target, table].join("/"))
end

- (Object) test_update_package_data



195
196
197
198
199
200
201
202
203
204
205
206
# File 'test/test_plugin/medwin.rb', line 195

def test_update_package_data
  @plugin.updated.clear
  pack = @app.packages[:normal]
  pack.pointer = "normal_pack"
  data = {
    :pharmacode => "123456\240",
  }
  @plugin.update_package_data(pack, data)
  result = @app.pointers.first
  assert_equal('normal_pack', result)
  assert_equal(['normal'], @plugin.updated)
end