Sha256: 7b05e7974161500b64c83100645b0bd83ef7a2b9ed04e1ddea3e10d935f84414

Contents?: true

Size: 1.36 KB

Versions: 8

Compression:

Stored size: 1.36 KB

Contents

RAILS_APP_NAME = 'tmp_app'
FIXTURES_PATH = ROOT_PATH + "/fixtures"
GEMFILES = {
  '2.3.5' => ROOT_PATH + '/Gemfile.rails.2.3.5',
  '3.0.3' => ROOT_PATH + '/Gemfile',
}

def fixture_path(version)
  "#{FIXTURES_PATH}/rails_#{version}"
end

def app_path(version)
  "#{fixture_path(version)}/#{RAILS_APP_NAME}"
end

##############################################################################

{
  '2.3.5' => "BUNDLE_GEMFILE=#{GEMFILES['2.3.5']} rails #{RAILS_APP_NAME} -m template.rb",
  '3.0.3' => "BUNDLE_GEMFILE=#{GEMFILES['3.0.3']} bundle exec rails new #{RAILS_APP_NAME} -m template.rb"
}.each do |version, rails_command|

  Given /^a Rails #{version} application set up for using dragonfly$/ do
    raise "Problem setting up Rails app" unless `
      cd #{fixture_path(version)} &&
      rm -rf #{RAILS_APP_NAME} &&
      #{rails_command}`
  end
  
end

Then /^the (.+) cucumber features in my Rails (.+) app should pass$/ do |filename, version|
  puts "\n*** RUNNING FEATURES IN THE RAILS APP... ***\n"
  path = File.join(fixture_path(version), RAILS_APP_NAME)
  `cd #{path} && BUNDLE_GEMFILE=#{GEMFILES[version]} RAILS_ENV=cucumber rake db:migrate`
  features_passed = system "cd #{path} && BUNDLE_GEMFILE=#{GEMFILES[version]} cucumber features/#{filename}.feature"
  puts "\n*** FINISHED RUNNING FEATURES IN THE RAILS APP ***\n"
  raise "Features failed" unless features_passed
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
dragonfly-0.8.6 features/steps/rails_steps.rb
dragonfly-0.8.5 features/steps/rails_steps.rb
dragonfly-0.8.4 features/steps/rails_steps.rb
fog-dragonfly-0.8.2 features/steps/rails_steps.rb
dragonfly-0.8.2 features/steps/rails_steps.rb
fog-dragonfly-0.8.1 features/steps/rails_steps.rb
dragonfly-0.8.1 features/steps/rails_steps.rb
dragonfly-0.8.0 features/steps/rails_steps.rb