Sha256: 12ba0644b47ba9fba1d531c67903f6365e5babeea16a8b4b835175119ab9a9db

Contents?: true

Size: 1.61 KB

Versions: 6

Compression:

Stored size: 1.61 KB

Contents

require 'aruba/cucumber'

When 'I run the rake task "$task_name"' do |task_name|
  in_current_dir do
    run "bundle exec rake #{task_name}"
  end
end

When 'I generate "$generator_with_args"' do |generator_with_args|
  in_current_dir do
    run "bundle exec rails generate #{generator_with_args}"
  end
end

Then 'I see a successful response in the shell' do
  assert_exit_status(0)
end

When 'I drop and create the required databases' do
  in_current_dir do
    run 'bundle exec rake db:drop RAILS_ENV=test'
    run 'bundle exec rake db:drop'
    run 'bundle exec rake db:create RAILS_ENV=test'
    run 'bundle exec rake db:create'
  end
end

When 'I suspend a project called "$project_name"' do |project_name|
  suspenders_bin = File.expand_path(File.join('..', '..', 'bin', 'suspenders'), File.dirname(__FILE__))
  run "#{suspenders_bin} #{project_name}"
  assert_exit_status(0)
end

When /^I suspend a project called "([^"]*)" with:$/ do |project_name, arguments_table|
  suspenders_bin = File.expand_path(File.join('..', '..', 'bin', 'suspenders'), File.dirname(__FILE__))
  arguments = arguments_table.hashes.inject([]) do |accum, argument|
    accum << "#{argument['argument']}=#{argument['value']}"
  end.join
  run "#{suspenders_bin} #{project_name} #{arguments}"
  assert_exit_status(0)
end

When 'I cd to the "$test_project" root' do |dirname|
  cd dirname
end

Then 'I can cleanly rake the project' do
  steps %{
    And I run the rake task "db:create"
    And I run the rake task "db:migrate"
    And I run the rake task "db:test:prepare"
    And I run the rake task "cucumber"
    Then I see a successful response in the shell
  }
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
suspenders-1.0.1 features/step_definitions/shell_steps.rb
suspenders-1.0.0 features/step_definitions/shell_steps.rb
suspenders-0.3.6 features/step_definitions/shell_steps.rb
suspenders-0.3.5 features/step_definitions/shell_steps.rb
suspenders-0.3.4 features/step_definitions/shell_steps.rb
suspenders-0.3.2 features/step_definitions/shell_steps.rb