Class: RSpec::Puppet::ManifestMatchers::Compile
- Inherits:
-
Object
- Object
- RSpec::Puppet::ManifestMatchers::Compile
- Defined in:
- lib/rspec-puppet/matchers/compile.rb
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message_for_should ⇒ Object
- #failure_message_for_should_not ⇒ Object
-
#initialize ⇒ Compile
constructor
A new instance of Compile.
- #matches?(catalogue) ⇒ Boolean
- #with_all_deps ⇒ Object
Constructor Details
#initialize ⇒ Compile
Returns a new instance of Compile.
4 5 6 7 8 |
# File 'lib/rspec-puppet/matchers/compile.rb', line 4 def initialize @failed_resource = "" @check_deps = false @cycles = [] end |
Instance Method Details
#description ⇒ Object
26 27 28 |
# File 'lib/rspec-puppet/matchers/compile.rb', line 26 def description "compile the catalogue without cycles" end |
#failure_message_for_should ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/rspec-puppet/matchers/compile.rb', line 30 def unless @cycles.empty? "dependency cycles found: #{@cycles.join('; ')}" else "expected that the catalogue would include #{@failed_resource}" end end |
#failure_message_for_should_not ⇒ Object
38 39 40 |
# File 'lib/rspec-puppet/matchers/compile.rb', line 38 def "expected that the catalogue would not compile but it does" end |
#matches?(catalogue) ⇒ Boolean
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rspec-puppet/matchers/compile.rb', line 15 def matches?(catalogue) @catalogue = catalogue if cycles_found? false elsif @check_deps == true && missing_dependencies? false else true end end |
#with_all_deps ⇒ Object
10 11 12 13 |
# File 'lib/rspec-puppet/matchers/compile.rb', line 10 def with_all_deps @check_deps = true self end |