Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: rodjek/rspec-puppet
...
head fork: rodjek/rspec-puppet
Checking mergeability… Don't worry, you can still create the pull request.
  • 4 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
View
6 lib/rspec-puppet/example/define_example_group.rb
@@ -31,7 +31,11 @@ def catalogue
Puppet[:code] = import_str + define_name + " { \"" + title + "\": " + param_str + " }"
nodename = self.respond_to?(:node) ? node : Puppet[:certname]
- facts_val = self.respond_to?(:facts) ? facts : {}
+ facts_val = {
+ 'hostname' => nodename.split('.').first,
+ 'fqdn' => nodename,
+ }
+ facts_val.merge!(facts) if self.respond_to?(:facts)
node_obj = Puppet::Node.new(nodename)
View
6 lib/rspec-puppet/matchers/create_generic.rb
@@ -2,7 +2,7 @@ module RSpec::Puppet
module Matchers
class CreateGeneric
def initialize(*args, &block)
- @exp_resource_type = args.shift.to_s.gsub(/^create_/, '')
+ @exp_resource_type = args.shift.to_s.gsub(/^(create|contain)_/, '')
@args = args
@block = block
@referenced_type = referenced_type(@exp_resource_type)
@@ -58,7 +58,7 @@ def description
private
def referenced_type(type)
- type.split('-').map { |r| r.capitalize }.join('::')
+ type.split('__').map { |r| r.capitalize }.join('::')
end
def errors
@@ -67,7 +67,7 @@ def errors
end
def method_missing(method, *args, &block)
- return RSpec::Puppet::Matchers::CreateGeneric.new(method, *args, &block) if method.to_s =~ /^create_/
+ return RSpec::Puppet::Matchers::CreateGeneric.new(method, *args, &block) if method.to_s =~ /^(create|contain)_/
super
end
end
View
2  rspec-puppet.gemspec
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'rspec-puppet'
- s.version = '0.0.2'
+ s.version = '0.0.3'
s.homepage = 'https://github.com/rodjek/rspec-puppet/'
s.summary = 'RSpec tests for your Puppet manifests'
s.description = 'RSpec tests for your Puppet manifests'
View
2  spec/classes/sysctl_common_spec.rb
@@ -1,7 +1,7 @@
require 'spec_helper'
describe 'sysctl::common' do
- it { should create_exec('sysctl/reload') \
+ it { should contain_exec('sysctl/reload') \
.with_command('/sbin/sysctl -p /etc/sysctl.conf').with_returns([0, 2]) }
it { should_not create_augeas('foo') }
end

No commit comments for this range

Something went wrong with that request. Please try again.