Skip to content

Instantly share code, notes, and snippets.

@carmstrong
Created January 23, 2014 05:49
Show Gist options
  • Save carmstrong/8573576 to your computer and use it in GitHub Desktop.
Save carmstrong/8573576 to your computer and use it in GitHub Desktop.
chefspec 3.1.4: undefined method `immediate_notifications' for #<ChefSpec::Runner:0x00000003be8590>
2) java::openjdk notifies set_attributes_from_version sends notification to update-java-alternatives
Failure/Error: expect(chef_run).to notify('java_alternatives').to(:set)
NoMethodError:
undefined method `immediate_notifications' for #<ChefSpec::Runner:0x00000003be8590>
# ./spec/openjdk_spec.rb:50:in `block (3 levels) in <top (required)>'=
------
test
describe 'notifies set_attributes_from_version' do
let(:chef_run) { ChefSpec::Runner.new.converge(described_recipe) }
it 'sends notification to update-java-alternatives' do
expect(chef_run).to notify('java_alternatives').to(:set)
end
end
------
recipe
java_alternatives 'set-java-alternatives' do
java_location jdk.java_home
priority jdk.alternatives_priority
case node['java']['jdk_version']
when "6"
bin_cmds node['java']['jdk']['6']['bin_cmds']
when "7"
bin_cmds node['java']['jdk']['7']['bin_cmds']
end
action :set
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment