Class: RSpec::Matchers::DefineConstant::Matcher
- Inherits:
-
Object
- Object
- RSpec::Matchers::DefineConstant::Matcher
- Includes:
- RSpec::Matcher
- Defined in:
- lib/rspec/matchers/define_constant/matcher.rb
Overview
runs block, checks if it defines constant, removes defined constant
Instance Attribute Summary collapse
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #description ⇒ Object
- #match ⇒ Object
- #of_type(type) ⇒ Object
- #supports_block_expectations? ⇒ Boolean
Instance Attribute Details
#type ⇒ Object
Returns the value of attribute type.
8 9 10 |
# File 'lib/rspec/matchers/define_constant/matcher.rb', line 8 def type @type end |
Instance Method Details
#description ⇒ Object
20 21 22 |
# File 'lib/rspec/matchers/define_constant/matcher.rb', line 20 def description "define constant" end |
#match ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/rspec/matchers/define_constant/matcher.rb', line 10 def match validate_input expected_shouldnt_exist actual.call expected_should_exist expected_should_have_correct_type true end |
#of_type(type) ⇒ Object
28 29 30 |
# File 'lib/rspec/matchers/define_constant/matcher.rb', line 28 def of_type type self.type = type and self end |
#supports_block_expectations? ⇒ Boolean
24 25 26 |
# File 'lib/rspec/matchers/define_constant/matcher.rb', line 24 def supports_block_expectations? true end |