Sha256: 353bda8ac3a91a80487202b124878813bc1ba3e3de434beafc7ae8c1f301c287

Contents?: true

Size: 1.05 KB

Versions: 16

Compression:

Stored size: 1.05 KB

Contents

PROJECT_ROOT     = File.expand_path(File.join(File.dirname(__FILE__), '..', '..')).freeze
APP_NAME         = 'testapp'.freeze
BUNDLE_ENV_VARS = %w(RUBYOPT BUNDLE_PATH BUNDLE_BIN_PATH BUNDLE_GEMFILE)
ORIGINAL_BUNDLE_VARS = Hash[ENV.select{ |key,value| BUNDLE_ENV_VARS.include?(key) }]

ENV['RAILS_ENV'] = 'test'

Before do
  ENV['BUNDLE_GEMFILE'] = File.join(Dir.pwd, ENV['BUNDLE_GEMFILE']) unless ENV['BUNDLE_GEMFILE'].start_with?(Dir.pwd)
  @framework_version = nil
end

After do
  ORIGINAL_BUNDLE_VARS.each_pair do |key, value|
    ENV[key] = value
  end
end

When /^I reset Bundler environment variable$/ do
  BUNDLE_ENV_VARS.each do |key|
    ENV[key] = nil
  end
end

module RailsCommandHelpers
  def framework_version?(version_string)
    framework_version =~ /^#{version_string}/
  end

  def framework_version
    @framework_version ||= `rails -v`[/^Rails (.+)$/, 1]
  end

  def new_application_command
    "rails new"
  end

  def generator_command
    "script/rails generate"
  end

  def runner_command
    "script/rails runner"
  end
end
World(RailsCommandHelpers)

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
paperclip-3.5.0 features/support/rails.rb
paperclip-3.4.2 features/support/rails.rb
paperclip-3.4.1 features/support/rails.rb
paperclip-3.4.0 features/support/rails.rb
paperclip-3.3.1 features/support/rails.rb
paperclip-3.2.1 features/support/rails.rb
paperclip-3.3.0 features/support/rails.rb
paperclip-3.2.0 features/support/rails.rb
paperclip-3.1.4 features/support/rails.rb
paperclip-3.1.2 features/support/rails.rb
paperclip-3.1.1 features/support/rails.rb
paperclip-3.1.0 features/support/rails.rb
paperclip-3.0.4 features/support/rails.rb
paperclip-3.0.3 features/support/rails.rb
cloudfuji_paperclip-3.0.3 features/support/rails.rb
paperclip-3.0.2 features/support/rails.rb