Skip to content

Instantly share code, notes, and snippets.

@marocchino
Last active December 17, 2015 12:39
Show Gist options
  • Save marocchino/5610989 to your computer and use it in GitHub Desktop.
Save marocchino/5610989 to your computer and use it in GitHub Desktop.
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
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