Class: ODDB::TestLppvWriter

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

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



14
15
16
17
18
19
20
# File 'test/test_plugin/lppv.rb', line 14

def setup
  @writer = LppvWriter.new
  @formatter = HtmlFormatter.new(@writer)
  @parser = HtmlParser.new(@formatter)
  @source = File.read(File.expand_path('../data/html/lppv/A.html', 
                                       File.dirname(__FILE__)))
end

- (Object) test_integrate



21
22
23
24
25
26
27
28
29
30
# File 'test/test_plugin/lppv.rb', line 21

def test_integrate
  @parser.feed(@source)
  expected = {
    '2347618' =>  Util::Money.new(32.00),
    '2347624' =>  Util::Money.new(58.00),
    '912103' => Util::Money.new(9.85),
    '1987273' =>  Util::Money.new(114.65),
  }
  assert_equal(expected, @writer.prices)
end