Object
# File lib/rspec/matchers/built_in/yield.rb, line 130 130: def description 131: desc = "yield with args" 132: desc << "(" + @expected.map { |e| e.inspect }.join(", ") + ")" if @expected.any? 133: desc 134: end
# File lib/rspec/matchers/built_in/yield.rb, line 122 122: def failure_message_for_should 123: "expected given block to yield with arguments, but #{positive_failure_reason}" 124: end
# File lib/rspec/matchers/built_in/yield.rb, line 171 171: def all_args_match? 172: return false if @expected.size != @actual.size 173: 174: @expected.zip(@actual).all? do |expected, actual| 175: expected === actual || actual == expected 176: end 177: end
# File lib/rspec/matchers/built_in/yield.rb, line 156 156: def args_match? 157: if @expected.none? # expect {...}.to yield_with_args 158: @positive_args_failure = "yielded with no arguments" if @actual.none? 159: return @actual.any? 160: end 161: 162: unless match = all_args_match? 163: @positive_args_failure = "yielded with unexpected arguments" + 164: "\nexpected: #{@expected.inspect}" + 165: "\n got: #{@actual.inspect} (compared using === and ==)" 166: end 167: 168: match 169: end
# File lib/rspec/matchers/built_in/yield.rb, line 146 146: def negative_failure_reason 147: if all_args_match? 148: "yielded with expected arguments" + 149: "\nexpected not: #{@expected.inspect}" + 150: "\n got: #{@actual.inspect} (compared using === and ==)" 151: else 152: "did" 153: end 154: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.