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.
287 288 289 |
# File 'lib/test/spec.rb', line 287 def initialize(obj) self.object = obj end |
Instance Attribute Details
#object ⇒ Object
Returns the value of attribute object.
285 286 287 |
# File 'lib/test/spec.rb', line 285 def object @object end |
Instance Method Details
#assumptions(*args, &block) ⇒ Object
300 301 302 |
# File 'lib/test/spec.rb', line 300 def assumptions(*args, &block) raise NotImplementedError, "you need to supply a #{self.class}#matches? method" end |
#failure_message ⇒ Object
291 292 293 |
# File 'lib/test/spec.rb', line 291 def "#{self.class.name} failed" end |
#matches?(*args, &block) ⇒ Boolean
295 296 297 298 |
# File 'lib/test/spec.rb', line 295 def matches?(*args, &block) assumptions(*args, &block) true end |