Commit Graph

64 Commits

Author SHA1 Message Date
Josh Hagins 99c96c0fc1 Fix tests broken by changing casks from classes to instances 2016-01-06 10:33:03 -05:00
Josh Hagins 0c548100fd Reorganize rake testing tasks
* Move 'rspec' and 'minitest' tasks under the 'test' namespace
* Create separate 'coverage' task for generating coverage reports
  from tests
2016-01-04 16:59:13 -05:00
Josh Hagins 970a221def Teach sudo helper to flatten argument list 2016-01-03 16:29:09 -05:00
Josh Hagins 97ec11fb58 Add `sudo` test helper to prepend command args with `/usr/bin/sudo -E --` 2016-01-03 16:29:09 -05:00
Josh Hagins b4c8ac8e87 Ensure user's HOMEBREW_CASK_OPTS has no effect on tests 2016-01-02 14:43:47 -05:00
Josh Hagins cd80f86afb Colorize minitest output with minitest-reporters gem 2015-12-27 23:20:54 -05:00
Josh Hagins fbfa795683 Use shared examples to DRY up *flight tests 2015-12-21 19:39:23 -05:00
Josh Hagins 7b486a827f Add support for RSpec-style shared examples in MiniTest 2015-12-21 19:39:21 -05:00
Josh Hagins 37f42f90df Report test coverage with coveralls 2015-03-17 21:20:41 -04:00
Paul Hinze 63d748e14c core: [refactor] separate Hbc::Cask from Hbc
Hbc is the namespace, Hbc::Cask is the object representing a Cask

One step on the path to reducing the surface area of the God-object
we've grown over the years. :)
2015-02-07 16:37:32 -06:00
Roland Walker b40b0c99e1 strip constants from homebrew-fork global.rb
and corresponding testing_env.rb.
* recast HOMEBREW_BREW_FILE as Hbc.homebrew_executable,
  defined in Hbc::Locations
* recast HOMEBREW_REPOSITORY as Hbc.homebrew_repository
* recast HOMEBREW_PREFIX as Hbc.homebrew_prefix
* remove HOMEBREW_LIBRARY
* recast existing Hbc.tapspath as Hbc.homebrew_tapspath
  to match new methods

fixes #8705
2015-01-07 09:09:53 -05:00
Roland Walker 202d6019f8 Move all code under an Hbc:: namespace
* convert existing Cask:: namespace to Hbc::
* move Homebrew-fork code under Hbc::
* move freestanding classes such as Tty and TopologicalHash under Hbc::
* recast HOMEBREW_CASK_ constants as HBC_
* modify our Homebrew Formula for backward compatibility
* devscripts and dev docs
2015-01-02 07:27:03 -05:00
Roland Walker 36b8903a36 flatten homebrew-fork and move it under vendor/lib
* remove transitional modifications to $LOAD_PATH
* all require statements are now explicit about loading from homebrew-fork
2014-12-31 07:57:18 -05:00
Roland Walker 05d6afa2ac remove homebrew-fork Pathname#/ monkeypatch
in favor of ordinary Pathname#join.  This was already the rule
for our codebase except for some areas of the test suite.
2014-12-26 11:06:34 -05:00
Roland Walker 62c2c83639 explicitly require Ruby 2.0 at all entry points
to give a more informative error
2014-12-20 10:25:56 -05:00
Roland Walker 6c41fe493b remove docs and code relevant to Ruby 1.8 compat 2014-12-16 08:50:33 -05:00
Roland Walker 1a238777ee Merge pull request #8089 from rolandwalker/homebrew_separation
Separate the Ruby backend from Homebrew + Require Ruby 2.x
2014-12-16 07:51:37 -05:00
Radek Simko 6bce46d2f2 Test options made consistent and documented 2014-12-14 13:16:10 +01:00
Roland Walker 32eca2e634 use homebrew-fork within test environment 2014-12-13 13:13:47 -05:00
Claudia c3266d38ce Add failing tests for `SystemCommand` 2014-12-08 13:06:46 +01:00
Roland Walker 707db75505 standardize Cask (capitalized) when used as noun
* was already done, but inconsistently
* this style follows homebrew Formula
* covers user-facing messages, test titles, comments
* some related minor orthography is included, such
  as the consistent spelling of our project name as
  "homebrew-cask"
* grammar nits
2014-10-08 10:39:51 -04:00
Roland Walker 49e6e6eb10 refactor :stderr => :silence
replace with :print_stderr => false

The double test on options[:print_stderr] in system_command.rb
is intentional, and temporary.
2014-09-25 09:23:27 -04:00
Roland Walker 1ddec7128d add uninstall :rmdir
per discussion at https://github.com/caskroom/homebrew-cask/pull/6174#discussion-diff-17516171
refs: #6174

This PR is large because of some test-suite refactoring.
2014-09-16 09:48:32 -04:00
Roland Walker 62fff58f48 define global `shutup` method (temporary)
solves the following error:
```bash
$ bundle exec rake test
...
NoMethodError: undefined method `shutup'
...
```

This is not a permanent solution.  The test suite should be changed
around to find the new `shutup` method, which is still in Homebrew,
but no longer global.
2014-06-19 10:06:55 -04:00
Roland Walker 04a84b5bef disable minitest-colorize
solves this error:
```bash
$ bundle exec rake test
...lib/minitest/colorize.rb:88:in `<top (required)>': undefined method `output=' for Minitest::Unit:Class (NoMethodError)
...
```
2014-06-19 10:04:04 -04:00
Roland Walker 0153c19f7a Defend against unusual Homebrew setups
To aid in Tap transition.  Require Homebrew 0.9.5, rescue
`rename_tags_dir_if_necessary` (`respond_to?` won't work there
because `rename_tags_dir_if_necessary` is a private method.

References: #4192, @Jackiebo in #4096
2014-05-07 09:50:42 -04:00
Paul Hinze f54eaf7082 update all references to new caskroom org home
global replace of:
  'phinze/homebrew-cask' -> 'caskroom/homebrew-cask'
  'phinze/cask' -> 'caskroom/cask'
  'phinze/homebrew-testcasks' -> 'caskroom/homebrew-testcasks'

and various other specific places that needed updates

<3 the homebrew-cask community!
2014-05-03 10:29:17 -05:00
Roland Walker 400433be20 Adapt to homebrew's move of the tap directory
Closes #4035. Closes #4029. Closes #4026.
2014-04-26 09:42:16 -04:00
Roland Walker 726a650ebd Merge pull request #3106 from rolandwalker/emojii
Emoji and disk usage stats at install success
2014-03-06 21:40:37 -05:00
Roland Walker 17be66076d remove constant HOMEBREW_TAP_FORMULA_REGEX
we no longer need to set this, as Homebrew added it to
testing_env.rb
2014-03-01 11:42:49 -05:00
Roland Walker c805b2b328 provide fallback setting for homebrew_path
this cannot hurt, and fixed a local problem
2014-03-01 11:40:54 -05:00
Roland Walker a75a4840cf Add 7z container support
relevant Casks must use `depends_on_formula unar`
2014-02-25 12:32:37 -05:00
Roland Walker d40195e8d4 Emoji and disk usage stats at install success
- consistent with Homebrew output
- respects Homebrew environment variables
- does not add any Homebrew code dependency
- really just for fun
2014-02-22 18:24:56 -05:00
Roland Walker d6c8a6917d add command `brew cask cleanup`
plus new option --outdated
2014-02-08 14:40:53 -05:00
Paul Hinze 9faa44e6cc Merge pull request #1992 from rolandwalker/core_fonts
CAB containers
2014-02-08 12:14:18 -06:00
Roland Walker 36ce20a4ee support CAB archives 2014-02-03 18:37:20 -05:00
Roland Walker 3633384036 add HOMEBREW_TAP_FORMULA_REGEX constant in tests
because our code tries to use it when throwing exceptions
also move HOMEBREW_BREW_FILE from doctor_test.rb to test_helper.rb
2014-02-01 12:47:05 -05:00
Peter Jaros fff4bb06ca Test qlplugindir auto-creation. 2013-11-29 12:01:11 -05:00
phinze 7ae7a18932 fixes to pkg uninstaller to prevent madness
- do not remove *all* symlinks from referenced dirs, only broken ones
 - restore dir permission after use so we don't leave behind 777 dirs
 - add some better testing around `Cask::Pkg`
 - clean up `FakeSystemCommand` interface in tests

refs #1274
2013-10-24 14:56:29 -05:00
phinze c03ada18ec support for nested containers
- this allows us to support casks for things like "dmg in zip" "zip in
   tar", etc, etc
 - a nested container can be any format that homebrew-cask supports
 - the existing container support is now referred to as a Cask's
   "primary container"
 - use the `nested_container` artifact type to indicate the relative
   path to a nested container that you wanted extracted
 - multiple layers of nesting should work with multiple nested_container
   directives (though this is untested as yet)
 - add SpeedDownload as the first cask to use this feature; refs #602
2013-10-19 16:20:00 -05:00
phinze c244385eb2 prefpane support; artifact refactor
= New Concept: Cask::Artifact

An Artifact is a file in an extacted container for which homebrew-cask
should take some sort of action on install/uninstall.

== Current artifacts:

 - App: link/unlink to ~/Applications
 - Pkg: install/uninstall (with sudo)
 - Prefpane: link/unlink to ~/Library/PreferencePanes

= New Feature: Preference Pane Handling

Specifying `prefpane 'MyApp.prefPane'` in a Cask causes it to be linked
on install to the correct location for it to show up in System
Preferences.

refs #69

= Removed Commands: linkapps/unlinkapps

These were old and mostly unused and don't really make much sense when
linking/unlinking happens automatically in the install process.

= Changed Behavior: stricter relative pathname requirement

With this refactor, we remove the fuzzy searching for a file in an
extracted container when that file was referenced from `link`
or `install`. There may be some casks that need to be updated due to
this change.
2013-10-07 13:51:42 -05:00
Robert Curth ba52f6377e [#583] Auditing of cask download and checksums
closes #688
2013-07-07 09:06:02 -05:00
Keith Smiley 6404f82d09 Verify appdir after reading command line opts
Helps prevent default appdir from being created regardless of whether
the user configured it or not.

Closes #496
2013-06-15 20:13:05 -05:00
Paul Hinze 17026b6e93 don't reinstall already installed casks
thanks to @ccutrer for the catch; this implementation is based on his PR

refs #233
2013-05-11 23:32:17 -05:00
phinze 04e3ef186f remove coveralls - no 1.8 support :( 2013-04-28 17:10:24 -05:00
phinze 9236a74393 lets try coveralls.io 2013-04-28 16:50:54 -05:00
phinze d4cecf35c9 programmatically modify alfred scope
refs #18
2013-04-28 13:56:26 -05:00
phinze 7a1a6a9308 support for caveats
i.e. custom messages printed after installing a cask

refs #218
2013-04-28 11:10:06 -05:00
phinze 74bdbd8f10 Merge branch 'apps-in-spotlight'
Closes #188
Closes #99
2013-04-12 08:30:15 -05:00
phinze 3b416ce7b5 add audits into the build process
this way travis will be able to cover incoming pull requests of new
casks by running the audit on them. cool!

also:

- add checksums to audit
- fix missing checksums
2013-04-07 14:30:09 -05:00