diff options
| author | Markus Reiter | 2017-05-09 23:00:51 +0200 |
|---|---|---|
| committer | Markus Reiter | 2017-05-15 17:23:40 +0200 |
| commit | 3cdf8f938a7cc31e366c49f8f5134a51bdcfdc7f (patch) | |
| tree | 39b61acf2a35ef536677395d47f177d35037f431 /Library/Homebrew/test/bash_spec.rb | |
| parent | ea8be174f6009bc9bdec67b13ca501b5b83fc4b8 (diff) | |
| download | brew-3cdf8f938a7cc31e366c49f8f5134a51bdcfdc7f.tar.bz2 | |
Use scoped RSpec matchers.
Diffstat (limited to 'Library/Homebrew/test/bash_spec.rb')
| -rw-r--r-- | Library/Homebrew/test/bash_spec.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Library/Homebrew/test/bash_spec.rb b/Library/Homebrew/test/bash_spec.rb index 1b0f15066..552607810 100644 --- a/Library/Homebrew/test/bash_spec.rb +++ b/Library/Homebrew/test/bash_spec.rb @@ -1,20 +1,20 @@ require "open3" -RSpec::Matchers.define :have_valid_bash_syntax do - match do |file| - stdout, stderr, status = Open3.capture3("/bin/bash", "-n", file) +describe "Bash" do + matcher :have_valid_bash_syntax do + match do |file| + stdout, stderr, status = Open3.capture3("/bin/bash", "-n", file) - @actual = [file, stderr] + @actual = [file, stderr] - stdout.empty? && status.success? - end + stdout.empty? && status.success? + end - failure_message do |(file, stderr)| - "expected that #{file} is a valid Bash file:\n#{stderr}" + failure_message do |(file, stderr)| + "expected that #{file} is a valid Bash file:\n#{stderr}" + end end -end -describe "Bash" do context "brew" do subject { HOMEBREW_LIBRARY_PATH.parent.parent/"bin/brew" } it { is_expected.to have_valid_bash_syntax } |
