Skip to content

Commit

Permalink
get integration tests working
Browse files Browse the repository at this point in the history
  • Loading branch information
klieber committed Apr 29, 2015
1 parent 1ead090 commit 436caca
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 43 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ gem 'cucumber'
gem 'rspec'
gem 'nokogiri', '~> 1.6.2.1'
gem 'relish'
gem 'capybara', '~> 2.0.2'
gem 'capybara', '~> 2.4.4'
gem 'rake'
gem 'selenium-webdriver', '~> 2.41.0'
#gem 'ruby-debug19'
Expand Down
81 changes: 49 additions & 32 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,82 @@ GEM
specs:
archive-tar-minitar (0.5.2)
builder (3.2.2)
capybara (2.0.3)
capybara (2.4.4)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0)
xpath (~> 1.0.0)
childprocess (0.5.3)
xpath (~> 2.0)
childprocess (0.5.6)
ffi (~> 1.0, >= 1.0.11)
cucumber (1.3.8)
cucumber (2.0.0)
builder (>= 2.1.2)
cucumber-core (~> 1.1.3)
diff-lcs (>= 1.1.3)
gherkin (~> 2.12.1)
gherkin (~> 2.12)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.0.2)
diff-lcs (1.2.4)
ffi (1.9.3)
gherkin (2.12.1)
multi_test (>= 0.1.2)
cucumber-core (1.1.3)
gherkin (~> 2.12.0)
diff-lcs (1.2.5)
domain_name (0.5.24)
unf (>= 0.0.5, < 1.0.0)
ffi (1.9.8)
gherkin (2.12.2)
multi_json (~> 1.3)
json (1.8.0)
mime-types (1.25)
http-cookie (1.0.2)
domain_name (~> 0.5)
json (1.8.2)
mime-types (2.5)
mini_portile (0.6.0)
multi_json (1.10.0)
multi_test (0.0.2)
multi_json (1.11.0)
multi_test (0.1.2)
netrc (0.10.3)
nokogiri (1.6.2.1)
mini_portile (= 0.6.0)
rack (1.5.2)
rack-test (0.6.2)
rack (1.6.0)
rack-test (0.6.3)
rack (>= 1.0)
rake (10.1.0)
relish (0.7)
rake (10.4.2)
relish (0.7.1)
archive-tar-minitar (>= 0.5.2)
json (>= 1.4.6)
rest-client (>= 1.6.1)
rest-client (1.6.7)
mime-types (>= 1.16)
rspec (2.14.1)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (2.14.5)
rspec-expectations (2.14.3)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.3)
rubyzip (1.1.3)
rest-client (>= 1.7.2)
rest-client (1.8.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
rspec (3.2.0)
rspec-core (~> 3.2.0)
rspec-expectations (~> 3.2.0)
rspec-mocks (~> 3.2.0)
rspec-core (3.2.3)
rspec-support (~> 3.2.0)
rspec-expectations (3.2.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.2.0)
rspec-mocks (3.2.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.2.0)
rspec-support (3.2.2)
rubyzip (1.1.7)
selenium-webdriver (2.41.0)
childprocess (>= 0.5.0)
multi_json (~> 1.0)
rubyzip (~> 1.0)
websocket (~> 1.0.4)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.1)
websocket (1.0.7)
xpath (1.0.0)
xpath (2.0.0)
nokogiri (~> 1.3)

PLATFORMS
ruby

DEPENDENCIES
capybara (~> 2.0.2)
capybara (> 2.0.2)
cucumber
nokogiri (~> 1.6.2.1)
rake
Expand Down
2 changes: 1 addition & 1 deletion features/step_definitions/browser_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
end

Then /page should contain "([^"]*)"$/ do |expected|
page.should have_content(expected)
expect(page).to have_content(expected)
end

18 changes: 9 additions & 9 deletions features/step_definitions/mvn_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,39 @@
end

Then /^the build should fail$/ do
@output.should match /BUILD FAILURE/
expect(@output).to match /BUILD FAILURE/
end

Then /^the build should succeed$/ do
@output.should match /BUILD SUCCESS/
expect(@output).to match /BUILD SUCCESS/
end

Then /^I should see "([^"]*)"$/ do |content|
@output.should match /#{content}.*/
expect(@output).to match /#{content}.*/
end

Then /^I should not see "([^"]*)"$/ do |content|
@output.should_not match content
expect(@output).not_to match content
end

Then /^the file "([^"]*)" should contain "(.*)"$/ do |file_name,content|
load_file(file_name).should match content
expect(load_file(file_name)).to match content
end

Then /^the file "([^"]*)" should not contain "(.*)"$/ do |file_name,content|
load_file(file_name).should_not match content
expect(load_file(file_name)).not_to match content
end

Then /^the file "([^"]*)" should have XML "(.*)"$/ do |file_name, xpath|
Nokogiri::XML.parse(load_file(file_name)).xpath(xpath).length.should be >= 1
expect(Nokogiri::XML.parse(load_file(file_name)).xpath(xpath).length).to be >= 1
end

Given /^the file "([^"]*)" does exist$/ do |file_name|
File.exist?(file_name).should be true
expect(File.exist?(file_name)).to be true
end

Then /^the file "([^"]*)" does not exist$/ do |file_name|
File.exist?(file_name).should be false
expect(File.exist?(file_name)).to be false
end

private
Expand Down

0 comments on commit 436caca

Please sign in to comment.