Class: Test::Spec::CustomShould
Instance Attribute Summary collapse
-
#object ⇒ Object
Returns the value of attribute object.
Instance Method Summary collapse
- #assumptions(*args, &block) ⇒ Object
- #failure_message ⇒ Object
-
#initialize(obj) ⇒ CustomShould
constructor
A new instance of CustomShould.
- #matches?(*args, &block) ⇒ Boolean
Constructor Details
#initialize(obj) ⇒ CustomShould
Returns a new instance of CustomShould.
312 313 314 |
# File 'lib/test/spec.rb', line 312 def initialize(obj) self.object = obj end |
Instance Attribute Details
#object ⇒ Object
Returns the value of attribute object.
310 311 312 |
# File 'lib/test/spec.rb', line 310 def object @object end |
Instance Method Details
#assumptions(*args, &block) ⇒ Object
325 326 327 |
# File 'lib/test/spec.rb', line 325 def assumptions(*args, &block) raise NotImplementedError, "you need to supply a #{self.class}#matches? method" end |
#failure_message ⇒ Object
316 317 318 |
# File 'lib/test/spec.rb', line 316 def "#{self.class.name} failed" end |
#matches?(*args, &block) ⇒ Boolean
320 321 322 323 |
# File 'lib/test/spec.rb', line 320 def matches?(*args, &block) assumptions(*args, &block) true end |