test/surrounded_context_test.rb in surrounded-0.4.1 vs test/surrounded_context_test.rb in surrounded-0.5.0
- old
+ new
@@ -88,10 +88,11 @@
delegate_missing_methods
end
class RoleAssignmentContext
extend Surrounded::Context
+ set_methods_as_triggers
initialize(:user, :other_user)
trigger :user_ancestors do
user.singleton_class.ancestors
@@ -106,10 +107,14 @@
end
trigger :check_other_user_response do
user.respond_to?(:a_method!)
end
+
+ def regular_method_trigger
+ user.respond_to?(:a_method!)
+ end
module User
def a_method!; end
end
module OtherUser
@@ -162,8 +167,12 @@
user = User.new('Jim')
context = ClassRoleAssignmentContext.new(user, self)
- context.check_user_response
+ assert context.check_user_response
+ end
+
+ it 'allows usage of regular methods for triggers' do
+ assert context.regular_method_trigger
end
end
\ No newline at end of file