Class: RSpec::Given::NaturalAssertion
- Inherits:
-
Object
- Object
- RSpec::Given::NaturalAssertion
- Defined in:
- lib/rspec/given/natural_assertion.rb
Constant Summary collapse
- VOID_SEXP =
[:void_stmt]
Instance Method Summary collapse
- #has_content? ⇒ Boolean
-
#initialize(block, env, line_extractor) ⇒ NaturalAssertion
constructor
A new instance of NaturalAssertion.
- #message ⇒ Object
- #using_rspec_assertion? ⇒ Boolean
Constructor Details
#initialize(block, env, line_extractor) ⇒ NaturalAssertion
Returns a new instance of NaturalAssertion.
32 33 34 35 36 37 |
# File 'lib/rspec/given/natural_assertion.rb', line 32 def initialize(block, env, line_extractor) @block = block @env = env @line_extractor = line_extractor set_file_and_line end |
Instance Method Details
#has_content? ⇒ Boolean
45 46 47 |
# File 'lib/rspec/given/natural_assertion.rb', line 45 def has_content? assertion_sexp != VOID_SEXP end |
#message ⇒ Object
49 50 51 52 53 54 55 |
# File 'lib/rspec/given/natural_assertion.rb', line 49 def @output = "Then expression failed at #{source_line}\n" explain_failure display_pairs(expression_value_pairs) @output << "\n" @output end |
#using_rspec_assertion? ⇒ Boolean
41 42 43 |
# File 'lib/rspec/given/natural_assertion.rb', line 41 def using_rspec_assertion? using_should? || using_expect? end |