test/errata_test.rb in errata-0.2.1 vs test/errata_test.rb in errata-0.2.2
- old
+ new
@@ -31,14 +31,10 @@
def is_a_ford?(row)
row.slice('MFR', 'Manufacturer', 'carline_mfr_name').any? { |k, v| v.upcase == 'FORD' }
end
- def is_a_rolls_royce_and_model_contains_bentley?(row)
- is_a_rolls_royce?(row) and model_contains_bentley?(row)
- end
-
def is_a_bentley?(row)
row.slice('MFR', 'Manufacturer', 'carline_mfr_name').any? { |k, v| v.upcase == 'BENTLEY' }
end
def is_a_rolls_royce?(row)
@@ -86,7 +82,13 @@
e = Errata.new :url => 'http://spreadsheets.google.com/pub?key=t9WkYT39zjrStx7ruCFrZJg',
:responder => AutomobileVariantGuru.new
alfa = { "carline_mfr_name"=>"ALFA ROMEO" }
e.correct!(alfa)
assert_equal 'Alfa Romeo', alfa['carline_mfr_name']
+ end
+
+ should "try multiple conditions" do
+ bentley = { 'carline_mfr_name' => 'ROLLS-ROYCE BENTLEY', "carline name" => 'Super Bentley' }
+ @e.correct!(bentley)
+ assert_equal 'Bentley', bentley['carline_mfr_name']
end
end