Sha256: 8625dbc9d52d8332f8303c07dee190a84d94e2e85c21ff61ab7b5e58f4f51fa3
Contents?: true
Size: 622 Bytes
Versions: 5
Compression:
Stored size: 622 Bytes
Contents
require 'test_helper' class BareObjectContext extend Surrounded::Context def initialize(number, string, user) map_roles(:number => number, :string => string, :user => user) end private_attr_reader :number, :string, :user role :user do def output [number.to_s, string, name].join(' - ') end end trigger :output do user.output end end describe Surrounded::Context, 'skips affecting non-surrounded objects' do it 'works with non-surrounded objects' do context = BareObjectContext.new(123,'hello', User.new('Jim')) assert_equal '123 - hello - Jim', context.output end end
Version data entries
5 entries across 5 versions & 1 rubygems