Skip to content

Commit

Permalink
test: Change more contexts to describes for better sentences
Browse files Browse the repository at this point in the history
- We could have added "to" to the `RSpec/ContextWording` list of valid
  `context` prefixes, but switching these to `describe` is less special.
  • Loading branch information
issyl0 committed Feb 21, 2021
1 parent dfebf71 commit 5793be5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions Library/Homebrew/test/cask/dsl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,37 +168,37 @@
cask.config = config
end

context "when it is 'zh'" do
describe "to 'zh'" do
let(:languages) { ["zh"] }

it { is_expected.to be_the_chinese_version }
end

context "when it is 'zh-XX'" do
describe "to 'zh-XX'" do
let(:languages) { ["zh-XX"] }

it { is_expected.to be_the_chinese_version }
end

context "when it is 'en'" do
describe "to 'en'" do
let(:languages) { ["en"] }

it { is_expected.to be_the_english_version }
end

context "when it is 'xx-XX'" do
describe "to 'xx-XX'" do
let(:languages) { ["xx-XX"] }

it { is_expected.to be_the_english_version }
end

context "when it is 'xx-XX,zh,en'" do
describe "to 'xx-XX,zh,en'" do
let(:languages) { ["xx-XX", "zh", "en"] }

it { is_expected.to be_the_chinese_version }
end

context "when it is 'xx-XX,en-US,zh'" do
describe "to 'xx-XX,en-US,zh'" do
let(:languages) { ["xx-XX", "en-US", "zh"] }

it { is_expected.to be_the_english_version }
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/test/os/mac/version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
expect(version).to be < Version.create("10.15")
end

context "when after Big Sur" do
describe "after Big Sur" do
specify "comparison with :big_sur" do
expect(big_sur_major).to eq :big_sur
expect(big_sur_major).to be <= :big_sur
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/test/requirement_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
end

describe "#build?" do
context "when :build tag is specified" do
context "when the :build tag is specified" do
subject { described_class.new([:build]) }

it { is_expected.to be_a_build_requirement }
Expand Down

0 comments on commit 5793be5

Please sign in to comment.