features/steps/rails_steps.rb in spork-0.5.3 vs features/steps/rails_steps.rb in spork-0.5.4

- old
+ new

@@ -9,30 +9,45 @@ 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' + $loaded_stuff << 'User' end """ - - Given 'a file named "app/helpers/application_helper.rb" with:', + Given 'a file named "app/models/user_observer.rb" with:', """ - module ApplicationHelper - ($loaded_stuff ||= []) << 'ApplicationHelper' + class UserObserver < ActiveRecord::Observer + $loaded_stuff << 'UserObserver' end """ - Given 'a file named "app/models/user_observer.rb" with:', + Given 'a file named "app/helpers/application_helper.rb" with:', """ - class UserObserver < ActiveRecord::Observer - ($loaded_stuff ||= []) << 'UserObserver' + 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' + $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 \ No newline at end of file