spec/imw/parsers/line_parser_spec.rb in imw-0.2.17 vs spec/imw/parsers/line_parser_spec.rb in imw-0.2.18
- old
+ new
@@ -54,11 +54,11 @@
results.length.should == 131
results.first.should == { :id => "ID", :name => "Name", :genus => "Genus", :species => "Species" }
end
it "should pass each hash to a block when given one" do
- results = returning([]) do |array|
+ results = [].tap do |array|
@parser.parse!(@file) do |hsh|
hsh.delete(:id)
array << hsh
end
end
@@ -76,10 +76,10 @@
results.first.class.should == OpenStruct
end
it "should pass each object to a block when given one and defined with a class" do
@parser.klass = OpenStruct
- results = returning([]) do |array|
+ results = [].tap do |array|
@parser.parse!(@file) do |obj|
obj.genus = nil
array << obj
end
end