Last active
December 17, 2015 12:39
-
-
Save marocchino/5610989 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
class Test | |
def self.messages | |
@messages ||= [] | |
end | |
end | |
describe Yahoo do | |
let(:yahoo_included_test_object) do | |
Test.send(:include, Yahoo) | |
Test.new | |
end | |
let(:test_object) do | |
Test.new | |
end | |
it { yahoo_included_test_object.class.messages.should include(:yahoo)} #여기까지는 괜찮음 | |
it { test_object.class.messages.should_not include(:yahoo)} # 실패 함! | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Yahoo | |
self.included(base) | |
base.messages << :yahoo | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment