Sha256: 4b9e7b491c91feb765903da40acbc93d6eca1978acf4b26919c255a1a736dbd2

Contents?: true

Size: 1.84 KB

Versions: 38

Compression:

Stored size: 1.84 KB

Contents

Given /^I am in a fresh rails project named "(.+)"$/ do |folder_name|
  @current_dir = SporkWorld::SANDBOX_DIR
  version_argument = ENV['RAILS_VERSION'] ? "_#{ENV['RAILS_VERSION']}_" : nil
  # run("#{SporkWorld::RUBY_BINARY} #{%x{which rails}.chomp} #{folder_name}")
  run([SporkWorld::RUBY_BINARY, '-I', Cucumber::LIBDIR, %x{which rails}.chomp, version_argument, folder_name].compact * " ")
  @current_dir = File.join(File.join(SporkWorld::SANDBOX_DIR, folder_name))
end


Given "the application has a model, observer, route, and application helper" do
  Given 'a file named "app/models/user.rb" with:',
    """
    class User < ActiveRecord::Base
      $loaded_stuff << 'User'
    end
    """
  Given 'a file named "app/models/user_observer.rb" with:',
    """
    class UserObserver < ActiveRecord::Observer
      $loaded_stuff << 'UserObserver'
    end
    """
  Given 'a file named "app/helpers/application_helper.rb" with:',
    """
    module ApplicationHelper
      $loaded_stuff << 'ApplicationHelper'
    end
    """
  Given 'the following code appears in "config/environment.rb" after /Rails::Initializer.run/:',
    """
      config.active_record.observers = :user_observer
    """
  Given 'the following code appears in "config/routes.rb" after /^end/:',
    """
      $loaded_stuff << 'config/routes.rb'
    """
  Given 'a file named "config/initializers/initialize_loaded_stuff.rb" with:',
    """
    $loaded_stuff ||= []
    """
  Given 'a file named "config/initializers/log_establish_connection_calls.rb" with:',
    """
    class ActiveRecord::Base
      class << self
        def establish_connection_with_load_logging(*args)
          establish_connection_without_load_logging(*args)
          $loaded_stuff << 'ActiveRecord::Base.establish_connection'
        end
        alias_method_chain :establish_connection, :load_logging
      end
    end
    """
end

Version data entries

38 entries across 38 versions & 7 rubygems

Version Path
panjiva-spork-0.8.6 features/steps/rails_steps.rb
panjiva-spork-0.8.5.1 features/steps/rails_steps.rb
panjiva-spork-0.8.5 features/steps/rails_steps.rb
bmabey-spork-0.5.9 features/steps/rails_steps.rb
timcharper-spork-0.5.10 features/steps/rails_steps.rb
timcharper-spork-0.5.9 features/steps/rails_steps.rb
timcharper-spork-0.6.0 features/steps/rails_steps.rb
timcharper-spork-0.6.1 features/steps/rails_steps.rb
timcharper-spork-0.6.2 features/steps/rails_steps.rb
timcharper-spork-0.6.3 features/steps/rails_steps.rb
spork-0.8.5 features/steps/rails_steps.rb
invo-sporknife-0.1.0.3 features/steps/rails_steps.rb
invo-sporknife-0.1.0.2 features/steps/rails_steps.rb
spork-0.8.4 features/steps/rails_steps.rb
spork-0.8.3 features/steps/rails_steps.rb
spork-0.8.2 features/steps/rails_steps.rb
spork-0.8.1 features/steps/rails_steps.rb
spork-0.8.0 features/steps/rails_steps.rb
spork-0.7.8 features/steps/rails_steps.rb
spork-0.7.7 features/steps/rails_steps.rb