Sha256: 605a9e30ddfa6a1771da002afbbe0e1f0c88b03c6cddda1ceaf825da6c51c89a
Contents?: true
Size: 756 Bytes
Versions: 19
Compression:
Stored size: 756 Bytes
Contents
require 'test_helper' describe Merit::SashFinder do it 'should return an array of sashes of the target objects' do sash_1 = Merit::Sash.new user_1 = User.new user_1.stubs(:_sash).returns(sash_1) sash_2 = Merit::Sash.new user_2 = User.new user_2.stubs(:_sash).returns(sash_2) # TODO: With stub we are not exercising compact # object_without_sash = OpenStruct.new # users = [user_1, user_2, object_without_sash] users = [user_1, user_2] rule = Merit::Rule.new action = Merit::Action.new Merit::SashFinder.stubs(:targets).returns(users) sashes = Merit::SashFinder.find(rule, action) _(sashes.count).must_be :==, 2 _(sashes).must_include sash_1 _(sashes).must_include sash_2 end end
Version data entries
19 entries across 19 versions & 2 rubygems