Permalink
Browse files

Use alias_method instead of alias_method_chain to fix wonkiness in rs…

…pec on 1.8.7 (close #16)
  • Loading branch information...
1 parent 3466849 commit 156bee318c7802c9392f8dc2b2fcade471ad0cf0 @bowsersenior bowsersenior committed Jul 27, 2011
Showing with 3 additions and 6 deletions.
  1. +3 −1 lib/yacht/rails.rb
  2. +0 −5 spec/yacht/rails_spec.rb
View
@@ -17,7 +17,9 @@ def full_file_path_for_config(config_type)
def all_with_rails_env
all_without_rails_env.merge('rails_env' => Rails.env)
end
- alias_method_chain :all, :rails_env
+ # alias_method_chain is wonky in rspec with ruby 1.8.7
+ alias_method :all_without_rails_env, :all
+ alias_method :all, :all_with_rails_env
end
end
View
@@ -43,10 +43,5 @@
Rails.stub(:env).and_return(:awesome)
subject.all_with_rails_env.should == {:foo => :bar, 'rails_env' => :awesome}
end
-
- it "aliases all to all_without_rails_env" do
- Object.should_receive(:alias_method_chain).with(:all, :rails_env)
- load "yacht/rails.rb"
- end
end
end

0 comments on commit 156bee3

Please sign in to comment.