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.
308 309 310 |
# File 'lib/test/spec.rb', line 308 def initialize(obj) self.object = obj end |
Instance Attribute Details
#object ⇒ Object
Returns the value of attribute object.
306 307 308 |
# File 'lib/test/spec.rb', line 306 def object @object end |
Instance Method Details
#assumptions(*args, &block) ⇒ Object
321 322 323 |
# File 'lib/test/spec.rb', line 321 def assumptions(*args, &block) raise NotImplementedError, "you need to supply a #{self.class}#matches? method" end |
#failure_message ⇒ Object
312 313 314 |
# File 'lib/test/spec.rb', line 312 def "#{self.class.name} failed" end |
#matches?(*args, &block) ⇒ Boolean
316 317 318 319 |
# File 'lib/test/spec.rb', line 316 def matches?(*args, &block) assumptions(*args, &block) true end |