Sha256: bb6c91e207f0ce6a1cfc11ef248878a1abd63a2a360f1dc1a2986efc20710af5
Contents?: true
Size: 624 Bytes
Versions: 11
Compression:
Stored size: 624 Bytes
Contents
require 'test_helper' # If you want to use wrappers, here's how you could class DelegateClassContext extend Surrounded::Context initialize(:user, :task) delegate_class :user, 'User' do def some_admin_method 'hello from the admin DelegateClass wrapper!' end end wrap :task do end trigger :do_something do user.some_admin_method end end describe DelegateClassContext do let(:context){ DelegateClassContext.new(User.new('jim'), Object.new) } it 'wraps objects using DelegateClass' do assert_equal 'hello from the admin DelegateClass wrapper!', context.do_something end end
Version data entries
11 entries across 11 versions & 1 rubygems