sample/features/step_definitions/steps.rb in cukedep-0.1.06 vs sample/features/step_definitions/steps.rb in cukedep-0.1.07
- old
+ new
@@ -8,22 +8,22 @@
Given(/^I add the video "(.*?)" to the catalogue$/) do |a_title|
$store.add_video(a_title)
end
Then(/^I should see the video "(.*?)" as unknown$/) do |a_title|
- $store.search_video(a_title).should be_nil
+ expect($store.search_video(a_title)).to be_nil
end
Then(/^I should see the video "(.*?)" as (available)$/) do |a_title, a_state|
found_video = $store.search_video(a_title)
- found_video.state.should == a_state.to_sym
+ expect(found_video.state).not_to eq(a_state.to_sym)
end
When(/^I remove the video "(.*?)"$/) do |a_title|
found_video = $store.search_video(a_title)
- found_video.should_not be_nil
- found_video.state.should == :available
+ expect(found_video).not_to be_nil
+ expect(found_video.state).to eq(:available)
$store.remove_video(found_video)
end
Given(/^there is no member yet$/) do
$store.send(:zap_members!) # Why is this method seen as private?
@@ -50,31 +50,31 @@
When(/^I enter the credentials "(.*?)"$/) do |credential|
@entered_credential = credential
end
Then(/^I should not be authorized$/) do
- $store.search_user(@entered_credential).should be_nil
+ expect($store.search_user(@entered_credential)).to be_nil
puts "Invalid user credential"
end
When(/^I register my credentials "(.*?)"$/) do |credential|
$store.add_user(credential)
end
Then(/^I should see a welcome message$/) do
- $store.search_user(@entered_credential).should_not be_nil
+ #expect($store.search_user(@entered_credential)).to be_nil
puts "Welcome to the rental application."
end
When(/^I register the rental of "(.*?)" for "(.*?)"$/) do |a_title, member_name|
found_video = $store.search_video(a_title)
- found_video.should_not be_nil
- found_video.state.should == :available
+ expect(found_video).not_to be_nil
+ expect(found_video.state).to eq(:available)
member = $store.search_member(member_name)
- member.should_not be_nil
+ expect(member).not_to be_nil
$store.add_rental(found_video, member)
@confirm_rental = true
end
Then(/^I should see the rental confirmed$/) do
@@ -87,11 +87,11 @@
end
When(/^I register the return of "(.*?)" from "(.*?)"$/) do |a_title, member_name|
rental = $store.search_rental(a_title)
- rental.should_not be_nil
- rental.member.should == member_name
+ expect(rental).not_to be_nil
+ expect(rental.member).to eq(member_name)
$store.close_rental(rental)
@confirm_return = true
end
Then(/^I should see the return confirmed$/) do
\ No newline at end of file