test/cases/gigo_test.rb in gigo-2.0.0 vs test/cases/gigo_test.rb in gigo-2.1.0

- old
+ new

@@ -28,11 +28,11 @@ end end describe '.load' do - + it 'ignores if string is not present' do GIGO.load('').must_equal '' GIGO.load(nil).must_be_nil o = Object.new GIGO.load(o).must_equal o @@ -57,11 +57,11 @@ it 'allows really bad data to be encoded using default replace and question marks' do GIGO.load(data_medico_unknown).must_equal "Med�co" end - it 'makes sure UTF-8 data read in as US-ASCII us fixed' do + it 'makes sure UTF-8 data read in as US-ASCII is fixed' do GIGO.load(data_medico_utf8.force_encoding('US-ASCII')).must_equal 'Medíco' end it 'converts windows codepages that are poorly marked as another encoding' do db_data1 = data_cp1252.dup.force_encoding('ASCII-8BIT') @@ -77,24 +77,25 @@ it 'converts iso8859 when poorly marked as another encoding' do GIGO.load(data_medico_iso88591).must_equal 'Medíco' GIGO.load(data_medico_iso88591.force_encoding('US-ASCII')).must_equal 'Medíco' end - it 'can make sure to it is really a valid encoding afterward' do + it 'readly bad data can be html escaped afterward' do html_escape GIGO.load(data_really_bad) end end describe '.transcoders' do it 'is an array of default transcoders' do - GIGO.transcoders.must_equal [ - GIGO::Transcoders::ActiveSupport, - GIGO::Transcoders::Blind - ] + if ActiveSupport::VERSION::STRING < '3.0' + GIGO.transcoders.must_equal [GIGO::Transcoders::CharlockHolmes, GIGO::Transcoders::ActiveSupport, GIGO::Transcoders::Blind] + else + GIGO.transcoders.must_equal [GIGO::Transcoders::ActiveSupport, GIGO::Transcoders::Blind] + end end end - + end end