Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

update steps for newer rails versions

reverting changes due to deprecation notices since cucumber is not
complaining with 1.9.3
added some missing dependencies for latest rails versions
  • Loading branch information...
commit 00441e01586e2c0723df055ab30a38e373445bac 1 parent c73d7e7
@shime shime authored
View
2  features/rails.feature
@@ -65,6 +65,7 @@ Feature: Install the Gem in a Rails application
And I configure the Airbrake shim
And I configure my application to require the "airbrake" gem
And I run the airbrake generator with "-k myapikey"
+ And I configure my application to require the "capistrano" gem if necessary
And I run "cap -T"
Then I should see "airbrake:deploy"
@@ -77,6 +78,7 @@ Feature: Install the Gem in a Rails application
And I run the airbrake generator with "-k myapikey"
And I uninstall the "airbrake" gem
And I install cached gems
+ And I configure my application to require the "capistrano" gem if necessary
And I run "cap -T"
Then I should see "airbrake:deploy"
View
20 features/step_definitions/rails_application_steps.rb
@@ -25,15 +25,17 @@
raise "Unable to generate a Rails application:\n#{@terminal.output}"
end
require_thread
- step %{I configure my application to require the "rake" gem with version "0.8.7"}
+ if rails_version_at_least("3.1.0")
+ When %{I configure my application to require the "therubyracer" gem with version "0.10.1"}
+ end
config_gem_dependencies unless rails3
end
When /^I run the airbrake generator with "([^\"]*)"$/ do |generator_args|
if rails3?
- step %{I run "./script/rails generate airbrake #{generator_args}"}
+ When %{I run "./script/rails generate airbrake #{generator_args}"}
else
- step %{I run "./script/generate airbrake #{generator_args}"}
+ When %{I run "./script/generate airbrake #{generator_args}"}
end
end
@@ -49,6 +51,10 @@
@terminal.build_and_install_gem(File.join(PROJECT_ROOT, "#{gem_name}.gemspec"))
end
+When /^I configure my application to require the "capistrano" gem if necessary$/ do
+ When %{I configure my application to require the "capistrano" gem} if rails_version_at_least("3.1.0")
+end
+
When /^I configure my application to require the "([^\"]*)" gem(?: with version "(.+)")?$/ do |gem_name, version|
if rails_manages_gems?
config_gem(gem_name, version)
@@ -75,7 +81,7 @@
Then /^I should receive a Airbrake notification$/ do
# myapi key is non-existent, but it should return the error notice
# hence this is success
- step %{I should see "Your account is being provisioned or no longer active."}
+ Then %{I should see "Your account is being provisioned or no longer active."}
end
Then /^I should receive two Airbrake notifications$/ do
@@ -180,7 +186,7 @@ def rails_non_initializer_airbrake_config_file
When /^I install cached gems$/ do
if bundler_manages_gems?
- step %{I run "bundle install"}
+ Then %{I run "bundle install"}
end
end
@@ -248,11 +254,11 @@ def rails_non_initializer_airbrake_config_file
end
Then /^I should see the Rails version$/ do
- step %{I should see "[Rails: #{rails_version}]"}
+ Then %{I should see "[Rails: #{rails_version}]"}
end
Then /^I should see that "([^\"]*)" is not considered a framework gem$/ do |gem_name|
- step %{I should not see "[R] #{gem_name}"}
+ Then %{I should not see "[R] #{gem_name}"}
end
Then /^the command should have run successfully$/ do
View
4 features/support/rails.rb
@@ -11,6 +11,10 @@ def rails3?
rails_version =~ /^3/
end
+ def rails_version_at_least(ver)
+ rails_version >= ver
+ end
+
def rails_root
LOCAL_RAILS_ROOT
end
Please sign in to comment.
Something went wrong with that request. Please try again.