Class: ActiveSpec::Specifications::NotSpecification
- Inherits:
-
Object
- Object
- ActiveSpec::Specifications::NotSpecification
- Defined in:
- lib/active_spec/specifications/not_specification.rb
Overview
A simple decorator class that negates the specification that it wraps, e.g.:
include ActiveSpec::Specifications
spec = AlwaysPassSpec.new(:foo)
spec.satisfied_by? # returns true
NotSpecification.new(spec).satisfied_by? # returns false
Instance Method Summary collapse
-
#initialize(decorated_spec) ⇒ NotSpecification
constructor
A new instance of NotSpecification.
- #satisfied_by?(object) ⇒ Boolean
Constructor Details
#initialize(decorated_spec) ⇒ NotSpecification
Returns a new instance of NotSpecification.
11 12 13 |
# File 'lib/active_spec/specifications/not_specification.rb', line 11 def initialize(decorated_spec) @decorated_spec = decorated_spec end |
Instance Method Details
#satisfied_by?(object) ⇒ Boolean
15 16 17 |
# File 'lib/active_spec/specifications/not_specification.rb', line 15 def satisfied_by?(object) not @decorated_spec.satisfied_by?(object) end |