Object
# File lib/mspec/matchers/be_computed_by_function.rb, line 2 def initialize(sym, *args) @function = sym @args = args end
# File lib/mspec/matchers/be_computed_by_function.rb, line 26 def failure_message ["Expected #{@value.inspect}", "to be computed by #{function_call}"] end
# File lib/mspec/matchers/be_computed_by_function.rb, line 18 def function_call function_call = "#{@function}" unless @arguments.empty? function_call << "(#{@arguments.map { |x| x.inspect }.join(", ")})" end function_call end
# File lib/mspec/matchers/be_computed_by_function.rb, line 7 def matches?(array) array.each do |line| @value = line.pop @arguments = line @arguments += @args return false unless send(@function, *@arguments) == @value end return true end
[Validate]
Generated with the Darkfish Rdoc Generator 2.