Skip to content

Commit

Permalink
Manual fixes for using Minitest
Browse files Browse the repository at this point in the history
  • Loading branch information
ngiger committed Sep 23, 2013
1 parent 6790a4b commit 5007d5f
Show file tree
Hide file tree
Showing 64 changed files with 274 additions and 314 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Expand Up @@ -82,6 +82,8 @@ gem "ydim"
gem "yus"
gem 'simplecov'

gem 'minitest'

group :development, :test do
gem 'hoe'
gem 'hoe-travis'
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Expand Up @@ -74,6 +74,7 @@ GEM
method_source (0.8.2)
mime-types (1.25)
mini_portile (0.5.1)
minitest (5.0.7)
money (5.1.1)
i18n (~> 0.6.0)
multi_json (1.8.0)
Expand Down Expand Up @@ -192,6 +193,7 @@ DEPENDENCIES
mail
mechanize
mime-types
minitest
money
multi_json
needle
Expand Down
3 changes: 2 additions & 1 deletion ext/export/test/test_generics_xls.rb
Expand Up @@ -161,6 +161,7 @@ def test_export_generics__case_no_output
# if the return value of registration.generics? is not false (ture) (point.2),
# then you have to define the other method in the flexstub(Package),
# since export_comparables or export_generic will be called.
registration = flexmock('registration')
pac = flexstub(@pac) do |pack|
pack.should_receive(:"registration.active?").and_return(true)
pack.should_receive(:"registration.original?").and_return(true)
Expand Down Expand Up @@ -190,7 +191,7 @@ def test_export_generics__case_warning
end

generics_xls = GenericXls.new(".")
assert_raise(NoMethodError) do # This means the report process runs if this assert passes
assert_raises(NoMethodError) do # This means the report process runs if this assert passes
generics_xls.export_generics
end
end
Expand Down
70 changes: 35 additions & 35 deletions ext/export/test/test_oddbdat.rb
Expand Up @@ -44,7 +44,7 @@ module ODDB
module OdbaExporter
DATE = Date.today.strftime("%Y%m%d%H%M%S")
# Tests for *Line classes
class TestLine < MiniTest::Unit::TestCase
class TestLine < Minitest::Test
Line::LENGTH = 3
def setup
@line = Line.new
Expand All @@ -64,7 +64,7 @@ def test_to_s
assert_equal('', @line.to_s)
end
end
class TestAcLine < MiniTest::Unit::TestCase
class TestAcLine < Minitest::Test
include FlexMock::TestCase
def setup
@package = ODDB::Package.new('12')
Expand Down Expand Up @@ -129,7 +129,7 @@ def test_structure
assert_equal(expected.sort, @acline.structure.sort)
end
end
class TestAccompLine < MiniTest::Unit::TestCase
class TestAccompLine < Minitest::Test
include FlexMock::TestCase
def test_structure
package = ODDB::Package.new('12')
Expand Down Expand Up @@ -157,7 +157,7 @@ def test_structure
assert_equal(expected.sort, @accompline.structure.sort)
end
end
class TestAcLimLine < MiniTest::Unit::TestCase
class TestAcLimLine < Minitest::Test
include FlexMock::TestCase
def test_structure
flexstub(Date).should_receive(:"today.strftime").and_return('20110203000000')
Expand All @@ -173,7 +173,7 @@ def test_structure
assert_equal(expected.sort, @aclimline.structure.sort)
end
end
class TestAcnamLine < MiniTest::Unit::TestCase
class TestAcnamLine < Minitest::Test
include FlexMock::TestCase
def setup
@package = ODDB::Package.new('12')
Expand Down Expand Up @@ -256,7 +256,7 @@ def test_structure__package_parts_not_nil_case
assert_equal(expected.sort, @acnamline.structure.sort)
end
end
class TestAcmedLine < MiniTest::Unit::TestCase
class TestAcmedLine < Minitest::Test
include FlexMock::TestCase
def test_structure
flexstub(Date).should_receive(:"today.strftime").and_return('20110203000000')
Expand Down Expand Up @@ -293,7 +293,7 @@ def test_structure
assert_equal(expected.sort, @acmedline.structure.sort)
end
end
class TestAcOddbLine < MiniTest::Unit::TestCase
class TestAcOddbLine < Minitest::Test
include FlexMock::TestCase
def test_structure
package = ODDB::Package.new('12')
Expand All @@ -307,7 +307,7 @@ def test_structure
assert_equal(expected.sort, @acoddbline.structure.sort)
end
end
class TestAcpricealgPublicLine < MiniTest::Unit::TestCase
class TestAcpricealgPublicLine < Minitest::Test
include FlexMock::TestCase
def setup
@package = ODDB::Package.new('12')
Expand All @@ -333,7 +333,7 @@ def test_structure
assert_equal(expected.sort, @acpriceline.structure.sort)
end
end
class TestAcpricealgExfactoryLine < MiniTest::Unit::TestCase
class TestAcpricealgExfactoryLine < Minitest::Test
include FlexMock::TestCase
def test_structure
package = ODDB::Package.new('12')
Expand All @@ -352,7 +352,7 @@ def test_structure
assert_equal(expected.sort, @acpriceline.structure.sort)
end
end
class TestAcscLine < MiniTest::Unit::TestCase
class TestAcscLine < Minitest::Test
include FlexMock::TestCase
def test_structure
# test nil case
Expand Down Expand Up @@ -389,7 +389,7 @@ def test_structure
assert_equal(expected.sort, @acscline.structure.sort)
end
end
class TestAtcLine < MiniTest::Unit::TestCase
class TestAtcLine < Minitest::Test
include FlexMock::TestCase
def test_structure
# test nil case
Expand All @@ -415,7 +415,7 @@ def test_structure
assert_equal(expected, @atcline.structure)
end
end
class TestCompLine < MiniTest::Unit::TestCase
class TestCompLine < Minitest::Test
include FlexMock::TestCase
def test_structure
company = flexmock('company') do |comp|
Expand Down Expand Up @@ -453,7 +453,7 @@ def test_structure
assert_equal(expected.sort, @compline.structure.sort)
end
end
class TestEanLine < MiniTest::Unit::TestCase
class TestEanLine < Minitest::Test
include FlexMock::TestCase
def setup
packclass = flexmock('package') do |pack|
Expand Down Expand Up @@ -482,7 +482,7 @@ def test_structure
assert_equal(expected, @eanline.structure)
end
end
class TestGalenicFormLine < MiniTest::Unit::TestCase
class TestGalenicFormLine < Minitest::Test
include FlexMock::TestCase
def test_structure
galenic_form = flexmock('galenic_form') do |gal|
Expand All @@ -502,7 +502,7 @@ def test_structure
assert_equal(expected.sort, @galenicline.structure.sort)
end
end
class TestScLine < MiniTest::Unit::TestCase
class TestScLine < Minitest::Test
include FlexMock::TestCase
def test_structure
package = ODDB::Package.new('12')
Expand All @@ -522,7 +522,7 @@ def test_structure
assert_equal(expected.sort, @scline.structure.sort)
end
end
class TestLimitationLine < MiniTest::Unit::TestCase
class TestLimitationLine < Minitest::Test
include FlexMock::TestCase
def test_structure
flexstub(Date).should_receive(:"today.strftime").and_return('20110203000000')
Expand All @@ -537,7 +537,7 @@ def test_structure
assert_equal(expected.sort, @limitationline.structure.sort)
end
end
class TestLimTxtLine < MiniTest::Unit::TestCase
class TestLimTxtLine < Minitest::Test
include FlexMock::TestCase
def test_structure
flexstub(Date).should_receive(:"today.strftime").and_return('20110203000000')
Expand All @@ -553,7 +553,7 @@ def test_structure
assert_equal(expected.sort, @limtxtline.structure.sort)
end
end
class TestMCMLine < MiniTest::Unit::TestCase
class TestMCMLine < Minitest::Test
include FlexMock::TestCase
def test_structure
flexstub(Date).should_receive(:"today.strftime").and_return('20110203000000')
Expand All @@ -572,30 +572,30 @@ def test_structure
end

# Tests for *Table classes
class TestTable < MiniTest::Unit::TestCase
class TestTable < Minitest::Test
Table::FILENAME = 'table'
def test_filename
table = Table.new
assert_equal('table', table.filename)
end
end
class TestAcTable < MiniTest::Unit::TestCase
class TestAcTable < Minitest::Test
include FlexMock::TestCase
def test_lines
flexstub(AcLine).should_receive(:new).and_return('acline')
@actable = AcTable.new
assert_equal(['acline'], @actable.lines('package'))
end
end
class TestAccompTable < MiniTest::Unit::TestCase
class TestAccompTable < Minitest::Test
include FlexMock::TestCase
def test_lines
flexstub(AccompLine).should_receive(:new).and_return('accompline')
@accomptable = AccompTable.new
assert_equal(['accompline'], @accomptable.lines('package'))
end
end
class TestAcLimTable < MiniTest::Unit::TestCase
class TestAcLimTable < Minitest::Test
include FlexMock::TestCase
def test_lines
# test package.sl_entry == nil calse
Expand All @@ -618,23 +618,23 @@ def test_lines
assert_kind_of(ODDB::OdbaExporter::AcLimLine, @aclimtable.lines(package).first)
end
end
class TestAcmedTable < MiniTest::Unit::TestCase
class TestAcmedTable < Minitest::Test
include FlexMock::TestCase
def test_lines
flexstub(AcmedLine).should_receive(:new).and_return('acmedline')
@acmedtable = AcmedTable.new
assert_equal(['acmedline'], @acmedtable.lines('package'))
end
end
class TestAcnamTable < MiniTest::Unit::TestCase
class TestAcnamTable < Minitest::Test
include FlexMock::TestCase
def test_lines
flexstub(AcnamLine).should_receive(:new).and_return('acnamline')
@acnamtable = AcnamTable.new
assert_equal(['acnamline'], @acnamtable.lines('package'))
end
end
class TestAcOddbTable < MiniTest::Unit::TestCase
class TestAcOddbTable < Minitest::Test
include FlexMock::TestCase
def test_lines
# test package.pharmacode nil case
Expand All @@ -648,7 +648,7 @@ def test_lines
assert_equal(['acoddbline'], @acoddbtable.lines(package))
end
end
class TestAcpricealgTable < MiniTest::Unit::TestCase
class TestAcpricealgTable < Minitest::Test
include FlexMock::TestCase
def test_lines
flexstub(AcpricealgPublicLine).should_receive(:new).and_return('acpricepublic')
Expand All @@ -657,7 +657,7 @@ def test_lines
assert_equal(["acpricepublic", "acpriceexfactory"], @acpricetable.lines('package'))
end
end
class TestAcscTable < MiniTest::Unit::TestCase
class TestAcscTable < Minitest::Test
include FlexMock::TestCase
def test_lines
active_agents = ['act']
Expand All @@ -671,7 +671,7 @@ def test_lines
assert_equal(['acscline'], @acsctable.lines(package))
end
end
class TestLimitationTable < MiniTest::Unit::TestCase
class TestLimitationTable < Minitest::Test
include FlexMock::TestCase
def test_lines
# test package.sl_entry nil case
Expand All @@ -694,7 +694,7 @@ def test_lines
assert_equal(['limitationline'], @limitationtable.lines(package))
end
end
class TestLimTxtTable < MiniTest::Unit::TestCase
class TestLimTxtTable < Minitest::Test
include FlexMock::TestCase
def test_lines
# test package.sl_entry nil case
Expand All @@ -720,7 +720,7 @@ def test_lines
assert_equal(['limtxtline'], @limtxttable.lines(package))
end
end
class TestEanTable < MiniTest::Unit::TestCase
class TestEanTable < Minitest::Test
include FlexMock::TestCase
def test_lines
flexstub(EanLine).should_receive(:new).and_return('eanline')
Expand All @@ -732,7 +732,7 @@ def test_lines
ODDB::Text::ImageLink = 'imagelink'
#ODDB::Text::Table = 'table'
SERVER_NAME = 'server_name/'
class TestMCMTable < MiniTest::Unit::TestCase
class TestMCMTable < Minitest::Test
include FlexMock::TestCase
def setup
@mcmtable = MCMTable.new
Expand Down Expand Up @@ -1294,7 +1294,7 @@ def test_format_lines_iopamiro
# the followings are necessary for TestCodesTable
AtcClass = 'atcclass'
GalenicForm = 'galenicform'
class TestCodesTable < MiniTest::Unit::TestCase
class TestCodesTable < Minitest::Test
include FlexMock::TestCase
def setup
flexstub(AtcLine).should_receive(:new).and_return('atcline')
Expand All @@ -1312,23 +1312,23 @@ def test_lines
assert_equal(['galenicformline'], @codestable.lines(GalenicForm))
end
end
class TestScTable < MiniTest::Unit::TestCase
class TestScTable < Minitest::Test
include FlexMock::TestCase
def test_lines
flexstub(ScLine).should_receive(:new).and_return('scline')
@sctable = ScTable.new
assert_equal(['scline'], @sctable.lines('substance'))
end
end
class TestCompTable < MiniTest::Unit::TestCase
class TestCompTable < Minitest::Test
include FlexMock::TestCase
def test_lines
flexstub(CompLine).should_receive(:new).and_return('compline')
@comptable = CompTable.new
assert_equal(['compline'], @comptable.lines('company'))
end
end
class TestReadme < MiniTest::Unit::TestCase
class TestReadme < Minitest::Test
def test_lines
expected = <<-EOS
oddbdat.tar.gz und oddbdat.zip enthalten die täglich aktualisierten Artikelstammdaten der ODDB. Die Daten werden von ywesee in das OddbDat-Format umgewandelt und allen gewünschten Systemlieferanten von Schweizer Spitälern zur Verfügung gestellt.
Expand Down
4 changes: 2 additions & 2 deletions ext/fiparse/src/fachinfo_doc.rb
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
# FachinfoDoc -- oddb -- 24.09.2003 -- rwaltert@ywesee.com

require 'rwv2/rwv2' unless defined?(Test::Unit)
require 'rwv2/rwv2' unless defined?(Minitest)
require 'fachinfo_writer'
require 'iconv'

Expand Down Expand Up @@ -298,5 +298,5 @@ def same_font?(font1, font2)
&& font1.italic? == font2.italic?
end
end
end unless defined?(Test::Unit)
end unless defined?(Minitest)
end
4 changes: 2 additions & 2 deletions ext/fiparse/src/fachinfo_pdf.rb
Expand Up @@ -4,7 +4,7 @@
# ODDB::Fachinfo -- oddb.org -- 26.10.2004 -- mwalder@ywesee.com rwaltert@ywesee.com

require 'fachinfo_writer'
require 'rpdf2txt/parser' unless defined?(Test::Unit)
require 'rpdf2txt/parser' unless defined?(Minitest)
require 'fileutils'

module ODDB
Expand Down Expand Up @@ -231,4 +231,4 @@ def send_paragraph
end
end
end
end unless defined?(Test::Unit)
end unless defined?(Minitest)

0 comments on commit 5007d5f

Please sign in to comment.