From 9f9849134fbc261b6989dd7a09f427c817e2de61 Mon Sep 17 00:00:00 2001 From: phinze Date: Fri, 5 Apr 2013 02:08:51 -0600 Subject: [PATCH] a quixotic journey to a passing travis build Squashed commit of the following: commit 379d19d38da69a25f2ddf0b802a2e1c9cd2e40df Author: phinze Date: Fri Apr 5 02:04:56 2013 -0600 concat out+err? commit 3414556d5e494c89a1b91322be666df9933d29f2 Author: phinze Date: Fri Apr 5 01:59:06 2013 -0600 switch to capture_subprocces_io commit d50a878bf20892db4d136530ff64e5cb94fe3ae4 Author: phinze Date: Fri Apr 5 01:42:41 2013 -0600 ensure later version of minitest commit 49078c48b024e1f1ed1b5d9785de60ec050ee261 Author: phinze Date: Fri Apr 5 01:30:12 2013 -0600 pull down a newer minitest hopefully to fix must_output commit 537b5ddd22de57f0fff812646a03b982725dfa23 Author: phinze Date: Fri Apr 5 01:24:53 2013 -0600 run a brew update in the build commit 1516456663f8840f5ffc22345e140c0b5aa23c96 Author: phinze Date: Fri Apr 5 01:22:31 2013 -0600 remove stray puts commit 4c8f8348f88ffd8eafd7a1f948f70dfbc881b416 Author: phinze Date: Fri Apr 5 01:16:10 2013 -0600 add expand_path to see if that helps commit c6e8aa160dd4c778497de4dca8f90f4519d76bd4 Author: phinze Date: Fri Apr 5 01:13:22 2013 -0600 add debugging output for travis --- .ruby-version | 1 + .travis.yml | 1 + Gemfile | 3 ++- Gemfile.lock | 11 ++++++----- test/cli/install_test.rb | 6 ++++-- test/cli/uninstall_test.rb | 12 ++++++++---- test/test_helper.rb | 9 ++++----- 7 files changed, 26 insertions(+), 17 deletions(-) create mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 000000000..4ff999b2c --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +1.8.7-p358 diff --git a/.travis.yml b/.travis.yml index 44e7e27a6..f5637988e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ language: objective-c +before_install: brew update install: bundle script: bundle exec rake test diff --git a/Gemfile b/Gemfile index e527ba535..bb809e42e 100644 --- a/Gemfile +++ b/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 diff --git a/Gemfile.lock b/Gemfile.lock index 339e41dc8..4f4c95dbf 100644 --- a/Gemfile.lock +++ b/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 diff --git a/test/cli/install_test.rb b/test/cli/install_test.rb index 949d8f97f..be60d2733 100644 --- a/test/cli/install_test.rb +++ b/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 diff --git a/test/cli/uninstall_test.rb b/test/cli/uninstall_test.rb index b7adae7f1..299d7e5e4 100644 --- a/test/cli/uninstall_test.rb +++ b/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 diff --git a/test/test_helper.rb b/test/test_helper.rb index a57e5a42d..422e4afa1 100644 --- a/test/test_helper.rb +++ b/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