Browse Source

fix typo in Cask.init :(

💩 this is what i get for doing things outside of test coverage

added a smoke test this time
phinze 12 years ago
parent
commit
c40dc63737
  1. 6
      lib/cask.rb
  2. 10
      test/cask_test.rb

6
lib/cask.rb

@ -32,12 +32,12 @@ class Cask
end
def self.appdir
Pathname.new(File.expand_path("~/Applications"))
@appdir ||= Pathname.new(File.expand_path("~/Applications"))
end
def self.init
HOMEBREW_CACHE.mkpath unless HOMEBREW_CACHE.exists?
appdir.mkpath unless appdir.exists?
HOMEBREW_CACHE.mkpath unless HOMEBREW_CACHE.exist?
appdir.mkpath unless appdir.exist?
end
def self.path(cask_title)

10
test/cask_test.rb

@ -37,4 +37,14 @@ describe Cask do
application.must_be :directory?
end
end
describe "init" do
it "sets up dependent directories required for us to properly function" do
HOMEBREW_CACHE.stubs(:exist?).returns(false)
Cask.appdir.stubs(:exist?).returns(false)
HOMEBREW_CACHE.expects :mkpath
Cask.appdir.expects :mkpath
Cask.init
end
end
end

Loading…
Cancel
Save