Skip to content

Commit de69a7a

Browse files
committed
Remove should from step definitions
1 parent f96ea3f commit de69a7a

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

features/step_definitions/curl_steps.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
within("pre.curl") do
55
if condition
6-
page.should have_content("Host")
7-
page.should have_content("Cookie")
6+
expect(page).to have_content("Host")
7+
expect(page).to have_content("Cookie")
88
else
9-
page.should_not have_content("Host")
10-
page.should_not have_content("Cookie")
9+
expect(page).to_not have_content("Host")
10+
expect(page).to_not have_content("Cookie")
1111
end
1212
end
1313
end

features/step_definitions/html_steps.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,29 @@
77
end
88

99
Then /^I should see the following resources:$/ do |table|
10-
all("h2").map(&:text).should == table.raw.flatten
10+
expect(all("h2").map(&:text)).to eq(table.raw.flatten)
1111
end
1212

1313
Then /^I should see the following parameters:$/ do |table|
1414
names = all(".parameters .name").map(&:text)
1515
descriptions = all(".parameters .description").map(&:text)
1616

17-
names.zip(descriptions).should == table.rows
17+
expect(names.zip(descriptions)).to eq(table.rows)
1818
end
1919

2020
Then(/^I should see the following response fields:$/) do |table|
2121
names = all(".response-fields .name").map(&:text)
2222
descriptions = all(".response-fields .description").map(&:text)
2323

24-
names.zip(descriptions).should == table.rows
24+
expect(names.zip(descriptions)).to eq(table.rows)
2525
end
2626

2727
Then /^I should see the following (request|response) headers:$/ do |part, table|
2828
actual_headers = page.find("pre.#{part}.headers").text
2929
expected_headers = table.raw.map { |row| row.join(": ") }
3030

3131
expected_headers.each do |row|
32-
actual_headers.should include(row.strip)
32+
expect(actual_headers).to include(row.strip)
3333
end
3434
end
3535

@@ -38,38 +38,38 @@
3838
expected_headers = table.raw.map { |row| row.join(": ") }
3939

4040
expected_headers.each do |row|
41-
actual_headers.should_not include(row.strip)
41+
expect(actual_headers).to_not include(row.strip)
4242
end
4343
end
4444

4545
Then /^I should see the route is "([^"]*)"$/ do |route|
46-
page.should have_css(".request.route", :text => route)
46+
expect(page).to have_css(".request.route", :text => route)
4747
end
4848

4949
Then /^I should see the following query parameters:$/ do |table|
5050
text = page.find("pre.request.query_parameters").text
5151
actual = text.split("\n")
5252
expected = table.raw.map { |row| row.join(": ") }
5353

54-
actual.should =~ expected
54+
expect(actual).to match(expected)
5555
end
5656

5757
Then /^I should see the response status is "([^"]*)"$/ do |status|
58-
page.should have_css(".response.status", :text => status)
58+
expect(page).to have_css(".response.status", :text => status)
5959
end
6060

6161
Then /^I should see the following request body:$/ do |request_body|
62-
page.should have_css("pre.request.body", :text => request_body)
62+
expect(page).to have_css("pre.request.body", :text => request_body)
6363
end
6464

6565
Then /^I should see the following response body:$/ do |response_body|
66-
page.should have_css("pre.response.body", :text => response_body)
66+
expect(page).to have_css("pre.response.body", :text => response_body)
6767
end
6868

6969
Then /^I should see the api name "(.*?)"$/ do |name|
7070
title = find("title").text
7171
header = find("h1").text
7272

73-
title.should eq(name)
74-
header.should eq(name)
73+
expect(title).to eq(name)
74+
expect(header).to eq(name)
7575
end

features/step_definitions/image_steps.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
Then /^the generated documentation should be encoded correctly$/ do
66
file = File.read(File.join(current_dir, "doc", "api", "foobars", "uploading_a_file.html"))
7-
file.should =~ /file\.png/
7+
expect(file).to match(/file\.png/)
88
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Then /^the file "(.*?)" should contain JSON exactly like:$/ do |file, exact_content|
22
prep_for_fs_check do
33
json = IO.read(file)
4-
JSON.parse(json).should == JSON.parse(exact_content)
4+
expect(JSON.parse(json)).to eq(JSON.parse(exact_content))
55
end
66
end

0 commit comments

Comments
 (0)