Skip to content

Commit

Permalink
make feaures and rake task work again.. using bundler 1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
bmabey committed Mar 26, 2011
1 parent a673f80 commit a841ae5
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
9 changes: 1 addition & 8 deletions Rakefile
Expand Up @@ -40,14 +40,7 @@ end
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new

namespace :example_app do
RSpec::Core::RakeTask.new do |spec|
desc "Specs for Example app"
spec.pattern = './examples/rails3_root/spec/**/*_spec.rb'
end
end

task :default => [:features, :spec, 'example_app:spec']
task :default => [:features, :spec]

desc "Cleans the project of any tmp file that should not be included in the gemspec."
task :clean do
Expand Down
4 changes: 2 additions & 2 deletions examples/rails3_root/Gemfile.lock
@@ -1,8 +1,8 @@
PATH
remote: ../../
specs:
email_spec (1.0.0)
rspec (~> 2.0.0)
email_spec (1.1.1)
rspec (~> 2.0)

GEM
remote: http://gemcutter.org/
Expand Down
14 changes: 10 additions & 4 deletions features/rails3_app.feature
Expand Up @@ -5,16 +5,22 @@ As a email_spec dev
I want to verify that the example rails 3 app runs all of it's features as expected

Scenario: generators test
Given the rails3 app is setup with the latest generators
When I run "rails g email_spec:steps >/dev/null" in the rails3 app
When I run "rails g email_spec:steps" in the rails3 app
Then the rails3 app should have the email steps in place

Scenario: regression test
Given the rails3 app is setup with the latest email steps
When I run "rake db:migrate RAILS_ENV=test >/dev/null" in the rails3 app
And I run "cucumber features -q --no-color 2>/dev/null" in the rails3 app
When I run "rake db:migrate RAILS_ENV=test" in the rails3 app
And I run "bundle exec cucumber features -q --no-color" in the rails3 app
Then I should see the following summary report:
"""
13 scenarios (5 failed, 8 passed)
110 steps (5 failed, 1 skipped, 104 passed)
"""

When I run "rake spec RAILS_ENV=test" in the rails3 app
Then I should see the following summary report:
"""
9 examples, 0 failures
"""

2 changes: 1 addition & 1 deletion features/sinatra_app.feature
Expand Up @@ -6,7 +6,7 @@ I want to verify that the example sinatra app runs all of it's features as expec

Scenario: regression test
Given the sinatra app is setup with the latest email steps
When I run "cucumber features -q --no-color" in the sinatra app
When I run "bundle exec cucumber features -q --no-color" in the sinatra app
Then I should see the following summary report:
"""
9 scenarios (5 failed, 4 passed)
Expand Down
2 changes: 1 addition & 1 deletion features/step_definitions/app_steps.rb
Expand Up @@ -39,7 +39,7 @@
end

When /^I run "([^\"]*)" in the (\w+) app$/ do |cmd, app_name|
cmd.gsub!('cucumber', "#{Cucumber::RUBY_BINARY} #{Cucumber::BINARY}")
#cmd.gsub!('cucumber', "#{Cucumber::RUBY_BINARY} #{Cucumber::BINARY}")
app_path = File.join(root_dir, 'examples', "#{app_name}_root")
app_specific_gemfile = File.join(app_path,'Gemfile')
Dir.chdir(app_path) do
Expand Down
2 changes: 1 addition & 1 deletion lib/email_spec/deliveries.rb
Expand Up @@ -9,7 +9,7 @@ def last_email_sent
end

def reset_mailer
if ActionMailer::Base.delivery_method == :cache
if defined?(ActionMailer) && ActionMailer::Base.delivery_method == :cache
mailer.clear_cache
else
deliveries.clear
Expand Down

0 comments on commit a841ae5

Please sign in to comment.