Class: RSpec::RubyContentMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/generator_spec/matchers/content/content_matcher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



3
4
5
# File 'lib/generator_spec/matchers/content/content_matcher.rb', line 3

def content
  @content
end

Instance Method Details

#debug_contentObject



17
18
19
# File 'lib/generator_spec/matchers/content/content_matcher.rb', line 17

def debug_content
  puts "Content: #{content}" if RSpec::Generator.debug?      
end

#failure_messageObject



9
10
11
# File 'lib/generator_spec/matchers/content/content_matcher.rb', line 9

def failure_message
  debug_content
end

#matches?(content) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/generator_spec/matchers/content/content_matcher.rb', line 5

def matches?(content)
  @content = content
end

#negative_failure_messageObject



13
14
15
# File 'lib/generator_spec/matchers/content/content_matcher.rb', line 13

def negative_failure_message
  debug_content
end