summaryrefslogtreecommitdiff
path: root/spec/bundler/bundler/plugin_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/bundler/bundler/plugin_spec.rb')
-rw-r--r--spec/bundler/bundler/plugin_spec.rb20
1 files changed, 6 insertions, 14 deletions
diff --git a/spec/bundler/bundler/plugin_spec.rb b/spec/bundler/bundler/plugin_spec.rb
index 8c95723bcc..c1c88ce480 100644
--- a/spec/bundler/bundler/plugin_spec.rb
+++ b/spec/bundler/bundler/plugin_spec.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require_relative "../support/streams"
-
RSpec.describe Bundler::Plugin do
Plugin = Bundler::Plugin
@@ -296,11 +294,9 @@ RSpec.describe Bundler::Plugin do
end
it "executes the hook" do
- out = capture(:stdout) do
+ expect do
Plugin.hook(Bundler::Plugin::Events::EVENT_1)
- end.strip
-
- expect(out).to eq("hook for event 1")
+ end.to output("hook for event 1\n").to_stdout
end
context "single plugin declaring more than one hook" do
@@ -311,12 +307,10 @@ RSpec.describe Bundler::Plugin do
RUBY
it "evals plugins.rb once" do
- out = capture(:stdout) do
+ expect do
Plugin.hook(Bundler::Plugin::Events::EVENT_1)
Plugin.hook(Bundler::Plugin::Events::EVENT_2)
- end.strip
-
- expect(out).to eq("loaded")
+ end.to output("loaded\n").to_stdout
end
end
@@ -326,11 +320,9 @@ RSpec.describe Bundler::Plugin do
RUBY
it "is passed to the hook" do
- out = capture(:stdout) do
+ expect do
Plugin.hook(Bundler::Plugin::Events::EVENT_1) { puts "win" }
- end.strip
-
- expect(out).to eq("win")
+ end.to output("win\n").to_stdout
end
end
end