diff options
| author | mansimarkaur | 2017-08-08 00:25:01 +0530 | 
|---|---|---|
| committer | mansimarkaur | 2017-08-27 01:18:40 +0530 | 
| commit | 6b5e4bb938c38bf97e9fd31fde1813bf93fe1b4d (patch) | |
| tree | 872556c340a9163881fd1061e361eff7b49e9a78 /Library/Homebrew/test/cleanup_spec.rb | |
| parent | 86f7d208d09c4ebb6e4ca3b4cbf82b563307d65d (diff) | |
| download | brew-6b5e4bb938c38bf97e9fd31fde1813bf93fe1b4d.tar.bz2 | |
Use let over instance_var
Diffstat (limited to 'Library/Homebrew/test/cleanup_spec.rb')
| -rw-r--r-- | Library/Homebrew/test/cleanup_spec.rb | 25 | 
1 files changed, 13 insertions, 12 deletions
diff --git a/Library/Homebrew/test/cleanup_spec.rb b/Library/Homebrew/test/cleanup_spec.rb index a66157976..98cdb9bd0 100644 --- a/Library/Homebrew/test/cleanup_spec.rb +++ b/Library/Homebrew/test/cleanup_spec.rb @@ -181,18 +181,19 @@ describe Homebrew::Cleanup do      end      context "cleans old files in HOMEBREW_CACHE" do +      let(:bottle) { (HOMEBREW_CACHE/"testball-0.0.1.bottle.tar.gz") } +      let(:testball) { (HOMEBREW_CACHE/"testball-0.0.1") } +        before(:each) do -        @bottle = (HOMEBREW_CACHE/"testball-0.0.1.bottle.tar.gz") -        @testball = (HOMEBREW_CACHE/"testball-0.0.1") -        FileUtils.touch(@bottle) -        FileUtils.touch(@testball) +        FileUtils.touch(bottle) +        FileUtils.touch(testball)          (HOMEBREW_CELLAR/"testball"/"0.0.1").mkpath          FileUtils.touch(CoreTap.instance.formula_dir/"testball.rb")        end        after(:each) do -        FileUtils.rm_rf(@bottle) -        FileUtils.rm_rf(@testball) +        FileUtils.rm_rf(bottle) +        FileUtils.rm_rf(testball)          FileUtils.rm_rf(HOMEBREW_CELLAR/"testball")          FileUtils.rm_rf(CoreTap.instance.formula_dir/"testball.rb")        end @@ -200,21 +201,21 @@ describe Homebrew::Cleanup do        it "cleans up file if outdated" do          allow(Utils::Bottles).to receive(:file_outdated?).with(any_args).and_return(true)          described_class.cleanup_cache -        expect(@bottle).not_to exist -        expect(@testball).not_to exist +        expect(bottle).not_to exist +        expect(testball).not_to exist        end        it "cleans up file if ARGV has -s and formula not installed" do          ARGV << "-s"          described_class.cleanup_cache -        expect(@bottle).not_to exist -        expect(@testball).not_to exist +        expect(bottle).not_to exist +        expect(testball).not_to exist        end        it "cleans up file if stale" do          puts described_class.cleanup_cache -        expect(@bottle).not_to exist -        expect(@testball).not_to exist +        expect(bottle).not_to exist +        expect(testball).not_to exist        end      end    end  | 
