Class: ChefSpec::Matchers::LinkToMatcher
- Inherits:
-
Object
- Object
- ChefSpec::Matchers::LinkToMatcher
- Defined in:
- lib/chefspec/matchers/link_to_matcher.rb
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message_for_should ⇒ Object
- #failure_message_for_should_not ⇒ Object
-
#initialize(path) ⇒ LinkToMatcher
constructor
A new instance of LinkToMatcher.
- #matches?(link) ⇒ Boolean
Constructor Details
#initialize(path) ⇒ LinkToMatcher
Returns a new instance of LinkToMatcher.
3 4 5 |
# File 'lib/chefspec/matchers/link_to_matcher.rb', line 3 def initialize(path) @path = path end |
Instance Method Details
#description ⇒ Object
15 16 17 |
# File 'lib/chefspec/matchers/link_to_matcher.rb', line 15 def description %Q{link to "#{@path}"} end |
#failure_message_for_should ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/chefspec/matchers/link_to_matcher.rb', line 19 def if @link.nil? %Q{expected "link[#{@path}]" with action :create to be in Chef run} else %Q{expected "#{@link}" to link to "#{@path}" but was "#{@link.to}"} end end |
#failure_message_for_should_not ⇒ Object
27 28 29 |
# File 'lib/chefspec/matchers/link_to_matcher.rb', line 27 def %Q{expected "#{@link}" to not link to "#{@path}"} end |