Sha256: 244d43fd7abb8bd1ac8f23b26bb061483f34c12a7f5b28dcab172007e747f9a6

Contents?: true

Size: 1.32 KB

Versions: 173

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

173 entries across 173 versions & 1 rubygems

Version Path
bard-1.0.1 features/step_definitions/global_steps.rb
bard-1.0.0 features/step_definitions/global_steps.rb
bard-0.69.2 features/step_definitions/global_steps.rb
bard-0.69.1 features/step_definitions/global_steps.rb
bard-0.69.0 features/step_definitions/global_steps.rb
bard-0.68.0 features/step_definitions/global_steps.rb
bard-0.67.0 features/step_definitions/global_steps.rb
bard-0.66.0 features/step_definitions/global_steps.rb
bard-0.65.0 features/step_definitions/global_steps.rb
bard-0.64.1 features/step_definitions/global_steps.rb
bard-0.64.0 features/step_definitions/global_steps.rb
bard-0.63.0 features/step_definitions/global_steps.rb
bard-0.62.2 features/step_definitions/global_steps.rb
bard-0.62.1 features/step_definitions/global_steps.rb
bard-0.62.0 features/step_definitions/global_steps.rb
bard-0.61.0 features/step_definitions/global_steps.rb
bard-0.60.0 features/step_definitions/global_steps.rb
bard-0.59.3 features/step_definitions/global_steps.rb
bard-0.59.2 features/step_definitions/global_steps.rb
bard-0.59.1 features/step_definitions/global_steps.rb