Class: RSpec::RubyContentMatchers::HaveRegion

Inherits:
RSpec::RubyContentMatcher show all
Defined in:
lib/code_spec/matchers/have_region.rb

Constant Summary

Constants inherited from RSpec::RubyContentMatcher

RSpec::RubyContentMatcher::ANY_GROUP, RSpec::RubyContentMatcher::LPAR, RSpec::RubyContentMatcher::OPT_ARGS, RSpec::RubyContentMatcher::OPT_SPACES, RSpec::RubyContentMatcher::Q_ANY_GROUP, RSpec::RubyContentMatcher::RPAR, RSpec::RubyContentMatcher::SPACES

Instance Attribute Summary collapse

Attributes inherited from RSpec::RubyContentMatcher

#alt_end, #content, #content_matches, #end_option

Instance Method Summary collapse

Methods inherited from RSpec::RubyContentMatcher

#any_args_expr, #args_expr, #args_msg, #comment_end, #debug, #debug?, #debug_content, #display, #display_content, #get_expr, #handle_result, #index, #indexes, #is_match?, #matches?, #opt

Constructor Details

#initialize(region) ⇒ HaveRegion

Returns a new instance of HaveRegion.



5
6
7
8
# File 'lib/code_spec/matchers/have_region.rb', line 5

def initialize(region)
  @region = region.to_s
  super @region      
end

Instance Attribute Details

#regionObject (readonly)

Returns the value of attribute region.



3
4
5
# File 'lib/code_spec/matchers/have_region.rb', line 3

def region
  @region
end

Instance Method Details

#failure_messageObject



10
11
12
13
# File 'lib/code_spec/matchers/have_region.rb', line 10

def failure_message 
  super
  display "Expected there to be a #{region} region"
end

#negative_failure_messageObject



15
16
17
18
# File 'lib/code_spec/matchers/have_region.rb', line 15

def negative_failure_message    
  super
  display "Did no expected there to be a #{region} region"
end