aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Reiter2016-08-27 11:52:14 +0200
committerMarkus Reiter2016-08-27 11:56:52 +0200
commitda2ad32a8d0c679576d62d47fea55479e66c330b (patch)
tree57148a58f96f6eb362074896b9bf7d848cbde995
parentf4fb655aaa907e8ec642469ae21ca03e6cef2e21 (diff)
downloadbrew-da2ad32a8d0c679576d62d47fea55479e66c330b.tar.bz2
Don’t use `should` syntax in rspec.
-rw-r--r--Library/Homebrew/cask/spec/cask/artifact/binary_spec.rb2
-rw-r--r--Library/Homebrew/cask/spec/cask/audit_spec.rb50
-rw-r--r--Library/Homebrew/cask/spec/cask/cli/style_spec.rb12
-rw-r--r--Library/Homebrew/cask/spec/cask/dsl/version_spec.rb10
-rw-r--r--Library/Homebrew/cask/spec/cask/verify/checksum_spec.rb12
-rw-r--r--Library/Homebrew/cask/spec/cask/verify_spec.rb4
-rw-r--r--Library/Homebrew/cask/spec/support/expectations_hash_helper.rb2
7 files changed, 46 insertions, 46 deletions
diff --git a/Library/Homebrew/cask/spec/cask/artifact/binary_spec.rb b/Library/Homebrew/cask/spec/cask/artifact/binary_spec.rb
index 81e5c9026..38b61a7e1 100644
--- a/Library/Homebrew/cask/spec/cask/artifact/binary_spec.rb
+++ b/Library/Homebrew/cask/spec/cask/artifact/binary_spec.rb
@@ -32,7 +32,7 @@ describe Hbc::Artifact::Binary do
Hbc::Artifact::Binary.new(cask).install_phase
end
- expect(expected_path).to_not be :symlink?
+ expect(expected_path).not_to be :symlink?
end
it "clobbers an existing symlink" do
diff --git a/Library/Homebrew/cask/spec/cask/audit_spec.rb b/Library/Homebrew/cask/spec/cask/audit_spec.rb
index 65a1335a5..87758a1af 100644
--- a/Library/Homebrew/cask/spec/cask/audit_spec.rb
+++ b/Library/Homebrew/cask/spec/cask/audit_spec.rb
@@ -22,7 +22,7 @@ describe Hbc::Audit do
audit.add_error "bad"
end
- it { should match(%r{failed}) }
+ it { is_expected.to match(%r{failed}) }
end
context "when there are warnings" do
@@ -30,7 +30,7 @@ describe Hbc::Audit do
audit.add_warning "eh"
end
- it { should match(%r{warning}) }
+ it { is_expected.to match(%r{warning}) }
end
context "when there are errors and warnings" do
@@ -39,11 +39,11 @@ describe Hbc::Audit do
audit.add_warning "eh"
end
- it { should match(%r{failed}) }
+ it { is_expected.to match(%r{failed}) }
end
context "when there are no errors or warnings" do
- it { should match(%r{passed}) }
+ it { is_expected.to match(%r{passed}) }
end
end
@@ -55,7 +55,7 @@ describe Hbc::Audit do
%w[version sha256 url name homepage license].each do |stanza|
context "when missing #{stanza}" do
let(:cask_token) { "missing-#{stanza}" }
- it { should fail_with(%r{#{stanza} stanza is required}) }
+ it { is_expected.to fail_with(%r{#{stanza} stanza is required}) }
end
end
end
@@ -65,7 +65,7 @@ describe Hbc::Audit do
context "when version is 'latest'" do
let(:cask_token) { "version-latest-string" }
- it { should fail_with(error_msg) }
+ it { is_expected.to fail_with(error_msg) }
end
context "when version is :latest" do
@@ -77,34 +77,34 @@ describe Hbc::Audit do
describe "sha256 checks" do
context "when version is :latest and sha256 is not :no_check" do
let(:cask_token) { "version-latest-with-checksum" }
- it { should fail_with("you should use sha256 :no_check when version is :latest") }
+ it { is_expected.to fail_with("you should use sha256 :no_check when version is :latest") }
end
context "when sha256 is not a legal SHA-256 digest" do
let(:cask_token) { "invalid-sha256" }
- it { should fail_with("sha256 string must be of 64 hexadecimal characters") }
+ it { is_expected.to fail_with("sha256 string must be of 64 hexadecimal characters") }
end
context "when sha256 is sha256 for empty string" do
let(:cask_token) { "sha256-for-empty-string" }
- it { should fail_with(%r{cannot use the sha256 for an empty string}) }
+ it { is_expected.to fail_with(%r{cannot use the sha256 for an empty string}) }
end
end
describe "appcast checks" do
context "when appcast has no sha256" do
let(:cask_token) { "appcast-missing-checkpoint" }
- it { should fail_with(%r{checkpoint sha256 is required for appcast}) }
+ it { is_expected.to fail_with(%r{checkpoint sha256 is required for appcast}) }
end
context "when appcast checkpoint is not a string of 64 hexadecimal characters" do
let(:cask_token) { "appcast-invalid-checkpoint" }
- it { should fail_with(%r{string must be of 64 hexadecimal characters}) }
+ it { is_expected.to fail_with(%r{string must be of 64 hexadecimal characters}) }
end
context "when appcast checkpoint is sha256 for empty string" do
let(:cask_token) { "appcast-checkpoint-sha256-for-empty-string" }
- it { should fail_with(%r{cannot use the sha256 for an empty string}) }
+ it { is_expected.to fail_with(%r{cannot use the sha256 for an empty string}) }
end
context "when appcast checkpoint is valid sha256" do
@@ -139,7 +139,7 @@ describe Hbc::Audit do
context "when HTTP code is not 200" do
let(:stdout) { "404" }
- it { should warn_with(wrong_code_msg) }
+ it { is_expected.to warn_with(wrong_code_msg) }
end
end
@@ -150,7 +150,7 @@ describe Hbc::Audit do
allow(fake_curl_result).to receive(:stderr).and_return("Some curl error")
end
- it { should warn_with(curl_error_msg) }
+ it { is_expected.to warn_with(curl_error_msg) }
end
end
@@ -181,7 +181,7 @@ describe Hbc::Audit do
context "when appcast checkpoint is out of date" do
let(:actual_checkpoint) { random_sha256 }
- it { should warn_with(mismatch_msg) }
+ it { is_expected.to warn_with(mismatch_msg) }
it { should_not warn_with(curl_error_msg) }
end
@@ -199,7 +199,7 @@ describe Hbc::Audit do
allow(fake_curl_result).to receive(:stderr).and_return("Some curl error")
end
- it { should warn_with(curl_error_msg) }
+ it { is_expected.to warn_with(curl_error_msg) }
end
end
end
@@ -209,7 +209,7 @@ describe Hbc::Audit do
context "with incorrect SourceForge URL format" do
let(:cask_token) { "sourceforge-incorrect-url-format" }
- it { should warn_with(warning_msg) }
+ it { is_expected.to warn_with(warning_msg) }
end
context "with correct SourceForge URL format" do
@@ -224,7 +224,7 @@ describe Hbc::Audit do
context "with incorrect OSDN URL format" do
let(:cask_token) { "osdn-incorrect-url-format" }
- it { should warn_with(warning_msg) }
+ it { is_expected.to warn_with(warning_msg) }
end
context "with correct OSDN URL format" do
@@ -236,12 +236,12 @@ describe Hbc::Audit do
describe "generic artifact checks" do
context "with no target" do
let(:cask_token) { "generic-artifact-no-target" }
- it { should fail_with(%r{target required for generic artifact}) }
+ it { is_expected.to fail_with(%r{target required for generic artifact}) }
end
context "with relative target" do
let(:cask_token) { "generic-artifact-relative-target" }
- it { should fail_with(%r{target must be absolute path for generic artifact}) }
+ it { is_expected.to fail_with(%r{target must be absolute path for generic artifact}) }
end
context "with absolute target" do
@@ -256,7 +256,7 @@ describe Hbc::Audit do
context "when loading the cask" do
it "does not evaluate the block" do
- expect { cask }.to_not raise_error
+ expect { cask }.not_to raise_error
end
end
@@ -278,7 +278,7 @@ describe Hbc::Audit do
context "when cask token conflicts with a core formula" do
let(:formula_names) { %w[with-binary other-formula] }
- it { should warn_with(%r{possible duplicate}) }
+ it { is_expected.to warn_with(%r{possible duplicate}) }
end
context "when cask token does not conflict with a core formula" do
@@ -308,7 +308,7 @@ describe Hbc::Audit do
download.expects(:perform).raises(StandardError.new(error_msg))
end
- it { should fail_with(%r{#{error_msg}}) }
+ it { is_expected.to fail_with(%r{#{error_msg}}) }
end
context "when verification fails" do
@@ -317,7 +317,7 @@ describe Hbc::Audit do
verify.expects(:all).raises(StandardError.new(error_msg))
end
- it { should fail_with(%r{#{error_msg}}) }
+ it { is_expected.to fail_with(%r{#{error_msg}}) }
end
end
@@ -327,7 +327,7 @@ describe Hbc::Audit do
cask.expects(:version).raises(StandardError.new)
end
- it { should fail_with(%r{exception while auditing}) }
+ it { is_expected.to fail_with(%r{exception while auditing}) }
end
end
end
diff --git a/Library/Homebrew/cask/spec/cask/cli/style_spec.rb b/Library/Homebrew/cask/spec/cask/cli/style_spec.rb
index 0e53d62a2..74ff10814 100644
--- a/Library/Homebrew/cask/spec/cask/cli/style_spec.rb
+++ b/Library/Homebrew/cask/spec/cask/cli/style_spec.rb
@@ -65,7 +65,7 @@ describe Hbc::CLI::Style do
end
it "exits successfully" do
- expect { subject }.to_not raise_error
+ expect { subject }.not_to raise_error
end
end
@@ -198,27 +198,27 @@ describe Hbc::CLI::Style do
context "when --fix is passed as an argument" do
let(:args) { ["adium", "--fix"] }
- it { should be_truthy }
+ it { is_expected.to be_truthy }
end
context "when --correct is passed as an argument" do
let(:args) { ["adium", "--correct"] }
- it { should be_truthy }
+ it { is_expected.to be_truthy }
end
context "when --auto-correct is passed as an argument" do
let(:args) { ["adium", "--auto-correct"] }
- it { should be_truthy }
+ it { is_expected.to be_truthy }
end
context "when --auto-correct is misspelled as --autocorrect" do
let(:args) { ["adium", "--autocorrect"] }
- it { should be_truthy }
+ it { is_expected.to be_truthy }
end
context "when no flag equivalent to --fix is passed as an argument" do
let(:args) { ["adium"] }
- it { should be_falsey }
+ it { is_expected.to be_falsey }
end
end
end
diff --git a/Library/Homebrew/cask/spec/cask/dsl/version_spec.rb b/Library/Homebrew/cask/spec/cask/dsl/version_spec.rb
index 04dcd06ca..b0efa2f10 100644
--- a/Library/Homebrew/cask/spec/cask/dsl/version_spec.rb
+++ b/Library/Homebrew/cask/spec/cask/dsl/version_spec.rb
@@ -10,30 +10,30 @@ describe Hbc::DSL::Version do
context "when other is nil" do
let(:other) { nil }
- it { should == false }
+ it { is_expected.to be false }
end
context "when other is a String" do
context "when other == self.raw_version" do
let(:other) { "1.2.3" }
- it { should == true }
+ it { is_expected.to be true }
end
context "when other != self.raw_version" do
let(:other) { "1.2.3.4" }
- it { should == false }
+ it { is_expected.to be false }
end
end
context "when other is a #{described_class}" do
context "when other.raw_version == self.raw_version" do
let(:other) { described_class.new("1.2.3") }
- it { should == true }
+ it { is_expected.to be true }
end
context "when other.raw_version != self.raw_version" do
let(:other) { described_class.new("1.2.3.4") }
- it { should == false }
+ it { is_expected.to be false }
end
end
end
diff --git a/Library/Homebrew/cask/spec/cask/verify/checksum_spec.rb b/Library/Homebrew/cask/spec/cask/verify/checksum_spec.rb
index 7209556c9..a5772b21d 100644
--- a/Library/Homebrew/cask/spec/cask/verify/checksum_spec.rb
+++ b/Library/Homebrew/cask/spec/cask/verify/checksum_spec.rb
@@ -21,25 +21,25 @@ describe Hbc::Verify::Checksum do
context "sha256 is :no_check" do
let(:sha256) { :no_check }
- it { should == false }
+ it { is_expected.to be false }
end
context "sha256 is nil" do
let(:sha256) { nil }
- it { should == true }
+ it { is_expected.to be true }
end
context "sha256 is empty" do
let(:sha256) { "" }
- it { should == true }
+ it { is_expected.to be true }
end
context "sha256 is a valid shasum" do
let(:sha256) { random_sha256 }
- it { should == true }
+ it { is_expected.to be true }
end
end
@@ -56,7 +56,7 @@ describe Hbc::Verify::Checksum do
let(:sha256) { computed }
it "does not raise an error" do
- expect { subject }.to_not raise_error
+ expect { subject }.not_to raise_error
end
end
@@ -64,7 +64,7 @@ describe Hbc::Verify::Checksum do
let(:sha256) { :no_check }
it "does not raise an error" do
- expect { subject }.to_not raise_error
+ expect { subject }.not_to raise_error
end
end
diff --git a/Library/Homebrew/cask/spec/cask/verify_spec.rb b/Library/Homebrew/cask/spec/cask/verify_spec.rb
index 7df77fea1..5925119ed 100644
--- a/Library/Homebrew/cask/spec/cask/verify_spec.rb
+++ b/Library/Homebrew/cask/spec/cask/verify_spec.rb
@@ -38,7 +38,7 @@ describe Hbc::Verify do
end
it "excludes inapplicable verifications" do
- expect(subject).to_not include(inapplicable_verification_class)
+ expect(subject).not_to include(inapplicable_verification_class)
end
end
@@ -58,7 +58,7 @@ describe Hbc::Verify do
it "runs only applicable verifications" do
expect(applicable_verification).to receive(:verify)
- expect(inapplicable_verification).to_not receive(:verify)
+ expect(inapplicable_verification).not_to receive(:verify)
subject
end
end
diff --git a/Library/Homebrew/cask/spec/support/expectations_hash_helper.rb b/Library/Homebrew/cask/spec/support/expectations_hash_helper.rb
index 8d386767d..726b1d053 100644
--- a/Library/Homebrew/cask/spec/support/expectations_hash_helper.rb
+++ b/Library/Homebrew/cask/spec/support/expectations_hash_helper.rb
@@ -3,7 +3,7 @@ module ExpectationsHashHelper
expectations.each do |input_value, expected_output|
context "when #{input_name} is #{input_value.inspect}" do
let(input_name.to_sym) { input_value }
- it { should == expected_output }
+ it { is_expected.to eq expected_output }
end
end
end