New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid be_falsey and be_truthy #2736
Changes from all commits
d020a8c
e961660
2616deb
0e2a20d
685117c
6f46e39
841df69
4f05d41
e7df10c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -296,16 +296,16 @@ | |
end | ||
|
||
describe "--fail-fast" do | ||
it "defaults to false" do | ||
expect(parse_options[:fail_fast]).to be_falsey | ||
it "defaults to nil" do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These concern me as they represent a change in how we document them, if they are wrong I almost want to fix them rather than the specs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't check the implementation, but I find it perfect that the setting is |
||
expect(parse_options[:fail_fast]).to be(nil) | ||
end | ||
|
||
it "sets fail_fast on config" do | ||
expect(parse_options("--fail-fast")[:fail_fast]).to be_truthy | ||
it "sets fail_fast to 1 on config" do | ||
expect(parse_options("--fail-fast")[:fail_fast]).to be(1) | ||
end | ||
|
||
it "sets fail_fast on config" do | ||
expect(parse_options("--no-fail-fast")[:fail_fast]).to be_falsey | ||
it "sets fail_fast to false on config" do | ||
expect(parse_options("--no-fail-fast")[:fail_fast]).to be(false) | ||
end | ||
end | ||
|
||
|
@@ -322,12 +322,12 @@ | |
end | ||
|
||
describe "--dry-run" do | ||
it "defaults to false" do | ||
expect(parse_options[:dry_run]).to be_falsey | ||
it "defaults to nil" do | ||
expect(parse_options[:dry_run]).to be(nil) | ||
end | ||
|
||
it "sets dry_run on config" do | ||
expect(parse_options("--dry-run")[:dry_run]).to be_truthy | ||
expect(parse_options("--dry-run")[:dry_run]).to be(true) | ||
end | ||
end | ||
|
||
|
@@ -464,7 +464,7 @@ def expect_parsing_to_fail_mentioning_source(source, options=[]) | |
|
||
expect(options[:requires]).to eq(["some_file"]) | ||
expect(options[:full_description]).to eq([/foo\ bar/]) | ||
expect(options[:drb]).to be_truthy | ||
expect(options[:drb]).to be(true) | ||
expect(options[:formatters]).to eq([['global']]) | ||
end | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is part of the documentation, not a copy of another spec so should be restored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it thinking that:
be_falsey
should not be encouragedcustom_setting
, only that we can alwaysexpect(nil).to be_falsey