Sha256: 3ebc04a5c19cd75363ff7ecc465408302ab4e66d1a9dffbb0edd7673dc1ba36c

Contents?: true

Size: 1.32 KB

Versions: 21

Compression:

Stored size: 1.32 KB

Contents

Given /^a shared rails project$/ do
  # TEARDOWN
  Dir.foreach "#{ROOT}/tmp" do |file|
    FileUtils.rm_rf("#{ROOT}/tmp/#{file}") unless %w(fixtures . ..).include? file
  end

  # SETUP
  Dir.chdir ROOT
  `cp -r tmp/fixtures/* tmp/`

  Dir.chdir 'tmp'
  @repos = {}
  %w(development_a development_b staging production).each do |env|
    @repos[env] = Grit::Repo.new env
  end
  Dir.chdir 'development_a'
  @repo = @repos['development_a']
  @env = { 'RAILS_ENV' => 'development', 'TESTING' => true }
end

Given /^I am in a subdirectory$/ do
  FileUtils.mkdir "test_subdirectory"
  Dir.chdir "test_subdirectory"
end

When /^I type "([^\"]*)"$/ do |command|
  type command.sub /\b(bard)\b/, "#{ROOT}/bin/bard"
end

When /^on (\w+), (.*$)/ do |env, step|
  old_env = @env['RAILS_ENV']
  @env['RAILS_ENV'] = env if %w(staging production).include? env
  Dir.chdir "#{ROOT}/tmp/#{env}" do
    old_repo = @repo
    @repo = @repos[env]
    When step
    @repo = old_repo
  end
  @env['RAILS_ENV'] = old_env
end

Then /^I should see the fatal error "([^\"]*)"$/ do |error_message|
  @stderr.should include(error_message)
end

Then /^I should see the warning "([^\"]*)"$/ do |warning_message|
  @stderr.should include(warning_message)
end

Then /^I should see "([^\"]*)"$/ do |message|
  @stdout.should include(message)
end

Then /^debug$/ do
  debugger
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
bard-1.3.9 features/step_definitions/global_steps.rb
bard-1.3.8 features/step_definitions/global_steps.rb
bard-1.3.7 features/step_definitions/global_steps.rb
bard-1.3.6 features/step_definitions/global_steps.rb
bard-1.3.5 features/step_definitions/global_steps.rb
bard-1.3.4 features/step_definitions/global_steps.rb
bard-1.3.3 features/step_definitions/global_steps.rb
bard-1.3.2 features/step_definitions/global_steps.rb
bard-1.3.1 features/step_definitions/global_steps.rb
bard-1.3.0 features/step_definitions/global_steps.rb
bard-1.2.0 features/step_definitions/global_steps.rb
bard-1.1.2 features/step_definitions/global_steps.rb
bard-1.1.1 features/step_definitions/global_steps.rb
bard-1.1.0 features/step_definitions/global_steps.rb
bard-1.0.8 features/step_definitions/global_steps.rb
bard-1.0.7 features/step_definitions/global_steps.rb
bard-1.0.6 features/step_definitions/global_steps.rb
bard-1.0.5 features/step_definitions/global_steps.rb
bard-1.0.4 features/step_definitions/global_steps.rb
bard-1.0.3 features/step_definitions/global_steps.rb