I wrote a test as follows:
context "on #{os}" do
it { is_expected.to compile.with_all_deps }
it { is_expected.to create_class('acpid') }
context 'base' do
it { is_expected.to contain_package('acpid').with( :ensure => 'latest')}
it { is_expected.to contain_service('acpid').that_requires('Package[acpid]') }
it { is_expected.to contain_service('acpid').with({
:ensure => 'running',
:enable => true,
:hasstatus => true,
:hasrestart => true,
:start => '/sbin/service haldaemon stop; /sbin/service acpid start; /sbin/service haldaemon start',
})
}
end
end
end
end end
When I run rspec spec/classes/init_spec.rb; I get the following errors:
1) acpid supported operating systems on centos-6-x86_64
Failure/Error: it { is_expected.to compile.with_all_deps }
NameError:
undefined local variable or method is_expected' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1::Nested_1:0x000000057b9aa8>
# ./spec/classes/init_spec.rb:10:in
block (5 levels) in '