test/example_proxy_test.rb in surrounded-0.9.9 vs test/example_proxy_test.rb in surrounded-0.9.10
- old
+ new
@@ -11,10 +11,14 @@
end
def talking_to_others
task.name
end
+
+ def combined_methods
+ some_admin_method
+ end
end
wrap :task do
end
@@ -39,10 +43,14 @@
end
trigger :get_admin_method do
admin.method(:talking_to_others)
end
+
+ trigger :combined_interface_methods do
+ admin.combined_methods
+ end
end
ProxyUser = Class.new do
def initialize(name)
@name = name
@@ -79,9 +87,18 @@
assert_match(%r{undefined local variable or method `task'}, err.message)
end
it 'sets roles to respond to role methods' do
assert context.admin_responds?
+ end
+
+ # A Negotiator object merely applies methods to another object
+ # so that once the method is called, the object has no knowledge
+ # of the module from which the method was applied.
+ it 'does not find other interface methods' do
+ assert_raises(NameError){
+ context.combined_interface_methods
+ }
end
it 'is able to grab methods from the object' do
assert_equal :talking_to_others, context.get_admin_method.name
end