spec/unit/braintree/resource_collection_spec.rb in braintree-4.14.0 vs spec/unit/braintree/resource_collection_spec.rb in braintree-4.15.0
- old
+ new
@@ -8,26 +8,26 @@
ids.map { |id| values[id] }
end
count = 0
collection.each_with_index do |item, index|
- item.should == values[index]
+ expect(item).to eq(values[index])
count += 1
end
- count.should == 5
+ expect(count).to eq(5)
end
end
describe "#first" do
it "returns nil with no results" do
values = %w(a b c d e)
collection = Braintree::ResourceCollection.new(:search_results => {:ids => [], :page_size => 2}) do |ids|
ids.map { |id| values[id] }
end
- collection.first.should == nil
+ expect(collection.first).to eq(nil)
end
context "with results" do
let(:collection) do
values = %w(a b c d e)
@@ -36,26 +36,26 @@
ids.map { |id| values[id] }
end
end
it "returns the first occourence" do
- collection.first.should == "a"
+ expect(collection.first).to eq("a")
end
it "returns the first N occourences" do
- collection.first(4).should == ["a","b","c","d"]
+ expect(collection.first(4)).to eq(["a","b","c","d"])
end
end
end
describe "#ids" do
it "returns a list of the resource collection ids" do
collection = Braintree::ResourceCollection.new(:search_results => {:ids => [0,1,2,3,4], :page_size => 2})
- collection.ids.should == [0,1,2,3,4]
+ expect(collection.ids).to eq([0,1,2,3,4])
end
end
it "returns an empty array when the collection is empty" do
collection = Braintree::ResourceCollection.new(:search_results => {:page_size => 2})
- collection.ids.should == []
+ expect(collection.ids).to eq([])
end
end