Sha256: 49e7265f1dcb00435440aba26d0539025b4b985bed3432f3b9fb3a659437c8c5
Contents?: true
Size: 413 Bytes
Versions: 14
Compression:
Stored size: 413 Bytes
Contents
require_relative '../../test_helper' class CallbackWithUnboundMethodTest < StateMachinesTest def setup @callback = StateMachines::Callback.new(:before, do: lambda { |*args| @context = args.unshift(self) }) @object = Object.new @callback.call(@object, {}, 1, 2, 3) end def test_should_call_method_outside_the_context_of_the_object assert_equal [self, @object, 1, 2, 3], @context end end
Version data entries
14 entries across 14 versions & 2 rubygems