spec/riak/index_collection_spec.rb in riak-client-1.4.5 vs spec/riak/index_collection_spec.rb in riak-client-2.0.0.rc1
- old
+ new
@@ -4,34 +4,34 @@
describe "json initialization" do
it "should accept a list of keys" do
@input = {
'keys' => %w{first second third}
}.to_json
- lambda { @coll = Riak::IndexCollection.new_from_json @input }.should_not raise_error
- %w{first second third}.should == @coll
+ expect { @coll = Riak::IndexCollection.new_from_json @input }.not_to raise_error
+ expect(%w{first second third}).to eq(@coll)
end
it "should accept a list of keys and a continuation" do
@input = {
'keys' => %w{first second third},
'continuation' => 'examplecontinuation'
}.to_json
- lambda { @coll = Riak::IndexCollection.new_from_json @input }.should_not raise_error
- %w{first second third}.should == @coll
- @coll.continuation.should == 'examplecontinuation'
+ expect { @coll = Riak::IndexCollection.new_from_json @input }.not_to raise_error
+ expect(%w{first second third}).to eq(@coll)
+ expect(@coll.continuation).to eq('examplecontinuation')
end
it "should accept a list of results hashes" do
@input = {
'results' => [
{'first' => 'first'},
{'second' => 'second'},
{'second' => 'other'}
]
}.to_json
- lambda { @coll = Riak::IndexCollection.new_from_json @input }.should_not raise_error
- %w{first second other}.should == @coll
- {'first' => %w{first}, 'second' => %w{second other}}.should == @coll.with_terms
+ expect { @coll = Riak::IndexCollection.new_from_json @input }.not_to raise_error
+ expect(%w{first second other}).to eq(@coll)
+ expect({'first' => %w{first}, 'second' => %w{second other}}).to eq(@coll.with_terms)
end
it "should accept a list of results hashes and a continuation" do
@input = {
'results' => [
{'first' => 'first'},
@@ -39,12 +39,12 @@
{'second' => 'other'}
],
'continuation' => 'examplecontinuation'
}.to_json
- lambda { @coll = Riak::IndexCollection.new_from_json @input }.should_not raise_error
- %w{first second other}.should == @coll
- @coll.continuation.should == 'examplecontinuation'
- {'first' => %w{first}, 'second' => %w{second other}}.should == @coll.with_terms
+ expect { @coll = Riak::IndexCollection.new_from_json @input }.not_to raise_error
+ expect(%w{first second other}).to eq(@coll)
+ expect(@coll.continuation).to eq('examplecontinuation')
+ expect({'first' => %w{first}, 'second' => %w{second other}}).to eq(@coll.with_terms)
end
end
end