summaryrefslogtreecommitdiff
path: root/spec/unit/event_dispatch/dsl_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/event_dispatch/dsl_spec.rb')
-rw-r--r--spec/unit/event_dispatch/dsl_spec.rb26
1 files changed, 13 insertions, 13 deletions
diff --git a/spec/unit/event_dispatch/dsl_spec.rb b/spec/unit/event_dispatch/dsl_spec.rb
index 0f7adce7a8..7c74e6738c 100644
--- a/spec/unit/event_dispatch/dsl_spec.rb
+++ b/spec/unit/event_dispatch/dsl_spec.rb
@@ -16,8 +16,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-require 'spec_helper'
-require 'chef/event_dispatch/dsl'
+require "spec_helper"
+require "chef/event_dispatch/dsl"
describe Chef::EventDispatch::DSL do
let(:events) do
@@ -32,25 +32,25 @@ describe Chef::EventDispatch::DSL do
Chef.set_run_context(run_context)
end
- subject{ described_class.new('test') }
+ subject{ described_class.new("test") }
- it 'set handler name' do
+ it "set handler name" do
subject.on(:run_started) {}
- expect(events.subscribers.first.name).to eq('test')
+ expect(events.subscribers.first.name).to eq("test")
end
- it 'raise error when invalid event type is supplied' do
+ it "raise error when invalid event type is supplied" do
expect do
subject.on(:foo_bar) {}
end.to raise_error(Chef::Exceptions::InvalidEventType)
end
- it 'register user hooks against valid event type' do
- subject.on(:run_failed) {'testhook'}
- expect(events.subscribers.first.run_failed).to eq('testhook')
+ it "register user hooks against valid event type" do
+ subject.on(:run_failed) {"testhook"}
+ expect(events.subscribers.first.run_failed).to eq("testhook")
end
- it 'preserve state across event hooks' do
+ it "preserve state across event hooks" do
calls = []
Chef.event_handler do
on :resource_updated do
@@ -60,13 +60,13 @@ describe Chef::EventDispatch::DSL do
calls << :started
end
end
- resource = Chef::Resource::RubyBlock.new('foo', run_context)
+ resource = Chef::Resource::RubyBlock.new("foo", run_context)
resource.block { }
resource.run_action(:run)
expect(calls).to eq([:started, :updated])
end
- it 'preserve instance variables across handler callbacks' do
+ it "preserve instance variables across handler callbacks" do
Chef.event_handler do
on :resource_action_start do
@ivar = [1]
@@ -75,7 +75,7 @@ describe Chef::EventDispatch::DSL do
@ivar << 2
end
end
- resource = Chef::Resource::RubyBlock.new('foo', run_context)
+ resource = Chef::Resource::RubyBlock.new("foo", run_context)
resource.block { }
resource.run_action(:run)
expect(events.subscribers.first.instance_variable_get(:@ivar)).to eq([1, 2])