Browse Source

a quixotic journey to a passing travis build

Squashed commit of the following:

commit 379d19d38da69a25f2ddf0b802a2e1c9cd2e40df
Author: phinze <paul.t.hinze@gmail.com>
Date:   Fri Apr 5 02:04:56 2013 -0600

    concat out+err?

commit 3414556d5e494c89a1b91322be666df9933d29f2
Author: phinze <paul.t.hinze@gmail.com>
Date:   Fri Apr 5 01:59:06 2013 -0600

    switch to capture_subprocces_io

commit d50a878bf20892db4d136530ff64e5cb94fe3ae4
Author: phinze <paul.t.hinze@gmail.com>
Date:   Fri Apr 5 01:42:41 2013 -0600

    ensure later version of minitest

commit 49078c48b024e1f1ed1b5d9785de60ec050ee261
Author: phinze <paul.t.hinze@gmail.com>
Date:   Fri Apr 5 01:30:12 2013 -0600

    pull down a newer minitest

    hopefully to fix must_output

commit 537b5ddd22de57f0fff812646a03b982725dfa23
Author: phinze <paul.t.hinze@gmail.com>
Date:   Fri Apr 5 01:24:53 2013 -0600

    run a brew update in the build

commit 1516456663f8840f5ffc22345e140c0b5aa23c96
Author: phinze <paul.t.hinze@gmail.com>
Date:   Fri Apr 5 01:22:31 2013 -0600

    remove stray puts

commit 4c8f8348f88ffd8eafd7a1f948f70dfbc881b416
Author: phinze <paul.t.hinze@gmail.com>
Date:   Fri Apr 5 01:16:10 2013 -0600

    add expand_path to see if that helps

commit c6e8aa160dd4c778497de4dca8f90f4519d76bd4
Author: phinze <paul.t.hinze@gmail.com>
Date:   Fri Apr 5 01:13:22 2013 -0600

    add debugging output for travis
phinze 12 years ago
parent
commit
9f9849134f
  1. 1
      .ruby-version
  2. 1
      .travis.yml
  3. 3
      Gemfile
  4. 11
      Gemfile.lock
  5. 6
      test/cli/install_test.rb
  6. 12
      test/cli/uninstall_test.rb
  7. 9
      test/test_helper.rb

1
.ruby-version

@ -0,0 +1 @@
1.8.7-p358

1
.travis.yml

@ -1,3 +1,4 @@
language: objective-c
before_install: brew update
install: bundle
script: bundle exec rake test

3
Gemfile

@ -2,5 +2,6 @@ source 'https://rubygems.org'
group :test do
gem 'rake'
gem 'purdytest'
gem 'minitest', '4.7.0'
gem 'minitest-colorize'
end

11
Gemfile.lock

@ -1,14 +1,15 @@
GEM
remote: https://rubygems.org/
specs:
minitest (2.12.1)
purdytest (1.0.0)
minitest (~> 2.2)
rake (10.0.1)
minitest (4.7.0)
minitest-colorize (0.0.5)
minitest (>= 2.0)
rake (10.0.4)
PLATFORMS
ruby
DEPENDENCIES
purdytest
minitest (= 4.7.0)
minitest-colorize
rake

6
test/cli/install_test.rb

@ -11,9 +11,11 @@ describe Cask::CLI::Install do
end
it "properly handles casks that are not present" do
lambda {
out, err = capture_subprocess_io do
Cask::CLI::Install.run('what-the-balls')
}.must_output <<-OUTPUT.gsub(/^ */, '')
end
(out+err).must_equal <<-OUTPUT.gsub(/^ */, '')
Error: No available cask for what-the-balls
OUTPUT
end

12
test/cli/uninstall_test.rb

@ -2,17 +2,21 @@ require 'test_helper'
describe Cask::CLI::Uninstall do
it "shows an error when a bad cask is provided" do
lambda {
out, err = capture_subprocess_io do
Cask::CLI::Uninstall.run('notacask')
}.must_output <<-OUTPUT.gsub(/^ */, '')
end
(out+err).must_equal <<-OUTPUT.gsub(/^ */, '')
Error: No available cask for notacask
OUTPUT
end
it "shows an error when a cask is provided that's not installed" do
lambda {
out, err = capture_subprocess_io do
Cask::CLI::Uninstall.run('anvil')
}.must_output <<-OUTPUT.gsub(/^ */, '')
end
(out+err).must_equal <<-OUTPUT.gsub(/^ */, '')
Error: anvil is not installed
OUTPUT
end

9
test/test_helper.rb

@ -1,5 +1,5 @@
require 'bundler/setup'
require 'pp'
# add cask lib to load path
brew_cask_path = Pathname.new(File.expand_path(__FILE__+'/../../'))
@ -19,20 +19,19 @@ require 'test/testing_env'
HOMEBREW_CACHE.mkpath
# must be called after testing_env so at_exit hooks are in proper order
require 'minitest/spec'
require 'minitest/autorun'
require 'purdytest'
require 'minitest-colorize'
# our baby
require 'cask'
# look for casks in testscasks by default
# look for casks in testcasks by default
Cask.default_tap = 'phinze-testcasks'
class TestHelper
# helper for test casks to reference local files easily
def self.local_binary(name)
path = File.join(File.dirname(__FILE__), 'support', 'binaries', name)
path = File.expand_path(File.join(File.dirname(__FILE__), 'support', 'binaries', name))
"file://#{path}"
end

Loading…
Cancel
Save