Sha256: 266d3c2920f660b3e4746e33d0e527fa4475a853df37955b24bd2ba035ffc1a3
Contents?: true
Size: 882 Bytes
Versions: 15
Compression:
Stored size: 882 Bytes
Contents
require 'test_helper' class EastTestContext extend Surrounded::Context east_oriented_triggers initialize :user, :other_user trigger :ask? do "asking a question..." end end describe Surrounded::Context, '.east_oriented_triggers' do let(:user){ User.new("Jim") } let(:other_user){ User.new("Guille") } let(:context){ EastTestContext.new(user, other_user) } it 'returns the context object from trigger methods' do assert_equal context, context.ask? end end describe Surrounded::Context, '.east_oriented_triggers with protect_triggers' do let(:user){ User.new("Jim") } let(:other_user){ User.new("Guille") } let(:context){ ctxt = EastTestContext.new(user, other_user) ctxt.singleton_class.send(:protect_triggers) ctxt } it 'returns the context object from trigger methods' do assert_equal context, context.ask? end end
Version data entries
15 entries across 15 versions & 1 rubygems