Class: Fix::It Private
- Inherits:
-
Spectus::ExpectationTarget
- Object
- Spectus::ExpectationTarget
- Fix::It
- Includes:
- Spectus::Matchers
- Defined in:
- lib/fix/it.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Wraps the target of an expectation.
Instance Method Summary collapse
-
#initialize(subject, challenges, helpers) ⇒ It
constructor
private
Create a new expection target.
-
#verify(&spec) ⇒ ::Spectus::Result::Pass, ::Spectus::Result::Fail
private
Verify the expectation.
Constructor Details
#initialize(subject, challenges, helpers) ⇒ It
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Create a new expection target
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/fix/it.rb', line 19 def initialize(subject, challenges, helpers) @subject = subject @challenges = challenges helpers.each do |method_name, method_block| define_singleton_method(method_name) do method_block.call end end end |
Instance Method Details
#verify(&spec) ⇒ ::Spectus::Result::Pass, ::Spectus::Result::Fail
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Verify the expectation.
35 36 37 38 39 |
# File 'lib/fix/it.rb', line 35 def verify(&spec) instance_eval(&spec) rescue ::Spectus::Result::Fail => e e end |