spec/support/matchers/delegate_matcher.rb in bigbluebutton_rails-1.4.0 vs spec/support/matchers/delegate_matcher.rb in bigbluebutton_rails-2.0.0

- old
+ new

@@ -31,10 +31,17 @@ elsif @delegator.respond_to?(@to, true) unless [0,-1].include?(@delegator.method(@to).arity) raise "#{@delegator}'s' #{@to} method does not have zero or -1 arity (it expects parameters)" end @delegator.stub(@to).and_return receiver_double(method) - @delegator.send(@method) == :called + + # in case it's a writer method + if @method.to_s[-1] == '=' + param = true + @delegator.send(@method, true) == param + else + @delegator.send(@method) == :called + end else raise "#{@delegator} does not respond to #{@to}" end end