diff options
| author | Markus Reiter | 2017-02-28 14:50:46 +0100 |
|---|---|---|
| committer | Markus Reiter | 2017-02-28 15:06:32 +0100 |
| commit | a5549023804a8cef50f71dc2d7a723be8e83f3d1 (patch) | |
| tree | 0c5bcf473909f755d209793892a21ce40f6bdd07 /Library/Homebrew/test/utils_spec.rb | |
| parent | 0457f0d3e2186991c16e2136b12a5ecc034d99da (diff) | |
| download | brew-a5549023804a8cef50f71dc2d7a723be8e83f3d1.tar.bz2 | |
Add `mktmpdir` helper method.
Diffstat (limited to 'Library/Homebrew/test/utils_spec.rb')
| -rw-r--r-- | Library/Homebrew/test/utils_spec.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Library/Homebrew/test/utils_spec.rb b/Library/Homebrew/test/utils_spec.rb index b3fdedcb9..90eed7d88 100644 --- a/Library/Homebrew/test/utils_spec.rb +++ b/Library/Homebrew/test/utils_spec.rb @@ -1,9 +1,7 @@ require "utils" describe "globally-scoped helper methods" do - let(:dir) { @dir = Pathname.new(Dir.mktmpdir) } - - after(:each) { dir.rmtree unless @dir.nil? } + let(:dir) { mktmpdir } def esc(code) /(\e\[\d+m)*\e\[#{code}m/ @@ -195,8 +193,7 @@ describe "globally-scoped helper methods" do end specify "#gzip" do - Dir.mktmpdir do |path| - path = Pathname.new(path) + mktmpdir do |path| somefile = path/"somefile" FileUtils.touch somefile expect(gzip(somefile)[0].to_s).to eq("#{somefile}.gz") |
