spec/cucumber/ast/table_spec.rb in cucumber-0.3.91 vs spec/cucumber/ast/table_spec.rb in cucumber-0.3.92
- old
+ new
@@ -225,20 +225,39 @@
| (-) aslak | (-) (i) "true" | (-) hellesøy | (-) (i) "false" |
| (+) aslak | (+) (i) true | (+) hellesøy | (+) (i) false |
}
end
- it "should allow column mapping before diffing" do
+ it "should allow column mapping of target before diffing" do
t1 = Table.new([
['name', 'male'],
['aslak', 'true']
])
t1.map_column!('male') { |m| m == 'true' }
t2 = Table.new([
['name', 'male'],
['aslak', true]
])
t1.diff!(t2)
+ t1.to_s(:indent => 12, :color => false).should == %{
+ | name | male |
+ | aslak | true |
+ }
+ end
+
+ it "should allow column mapping of argument before diffing" do
+ t1 = Table.new([
+ ['name', 'male'],
+ ['aslak', true]
+ ])
+ t1.map_column!('male') {
+ 'true'
+ }
+ t2 = Table.new([
+ ['name', 'male'],
+ ['aslak', 'true']
+ ])
+ t2.diff!(t1)
t1.to_s(:indent => 12, :color => false).should == %{
| name | male |
| aslak | true |
}
end