method
new
1.3.0 -
Show latest stable
-
0 notes -
Class: Spec::Matchers::Matcher
- 1.1.4
- 1.1.12
- 1.2.0 (0)
- 1.2.8 (0)
- 1.3.0 (0)
- 1.3.1 (0)
- What's this?
new(name, *expected, &declarations)
public
Hide source
# File lib/spec/matchers/matcher.rb, line 10 def initialize(name, *expected, &declarations) @name = name @expected = expected @actual = nil @diffable = false @expected_exception = nil @messages = { :description => lambda {"#{name_to_sentence}#{expected_to_sentence}"}, :failure_message_for_should => lambda {|actual| "expected #{actual.inspect} to #{name_to_sentence}#{expected_to_sentence}"}, :failure_message_for_should_not => lambda {|actual| "expected #{actual.inspect} not to #{name_to_sentence}#{expected_to_sentence}"} } making_declared_methods_public do instance_exec(*@expected, &declarations) end end