Skip to content

Commit 9a528eb

Browse files
committed
BAU: drive-by fix for unhandled stdout
We had two tests which checked that the `aws_authenticated?` method returned false when not authenticated, and that it printed a warning to stdout. Instead, do it as one test, and eat the output in the test, so that it doesn't pollute the test output when running the full suite.
1 parent a7702ec commit 9a528eb

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

support/forms-cli/spec/utilities/helpers_spec.rb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77

88
describe ".aws_authenticated?" do
99
context "when not authenticated" do
10-
it "returns false" do
11-
expect(dummy_class.new.aws_authenticated?).to be false
12-
end
13-
14-
it "prints warning to stdout" do
15-
expect { dummy_class.new.aws_authenticated? }.to output(/You must be authenticated/).to_stdout
10+
it "returns false and prints warning to stdout" do
11+
result = nil
12+
expect { result = dummy_class.new.aws_authenticated? }.to output(/You must be authenticated/).to_stdout
13+
expect(result).to be false
1614
end
1715
end
1816

0 commit comments

Comments
 (0)