Commit Graph

36 Commits

Author SHA1 Message Date
Josh Hagins 37f42f90df Report test coverage with coveralls 2015-03-17 21:20:41 -04:00
Paul Hinze b1d621503d internal: spec-ify SystemComand tests 2015-02-08 09:17:23 -06:00
Roland Walker add0279512 Merge pull request #9478 from caskroom/rename-cleanup-cli-option
cli: [refactor] rename outdated option internally
2015-02-07 19:12:13 -05:00
Paul Hinze 5bbba24bf9 cli: [refactor] rename outdated option internally
The `Hbc.outdated` boolean was in the way of my implementation of an
`outdated` scope for `brew cask outdated`, so I took the opportunity to:

 * rename the flag internally to `cleanup_outdated`
 * move the cleanup tests over to rspec and rework them to test in a
   stubbed cleanroom environment
 * refactor the implementation of cleanup to make it a bit more
   testable - most importantly: inject the cache location and outdated
   config dependencies instead of looking them up from constants

Note that there's no change to the user-facing interface, it's still

```
brew cask cleanup --outdated
```
2015-02-07 18:06:51 -06: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
Radek Simko 226da2fe1d Add test for creating binarydir if it doesn't exist 2015-01-24 22:54:33 +00:00
Radek Simko adc695a035 Test casks decoupled 2015-01-24 21:12:26 +00:00
Radek Simko ab8d31ab16 TempEnvVarHelper -> EnvHelper placed into its own class (avoid monkey patching) 2015-01-24 20:57:18 +00:00
Radek Simko 6b3146aed6 binary_test (minitest) -> binary_spec (rspec) 2015-01-24 20:01:54 +00:00
Radek Simko 5496c8f531 Refactored test helpers for rspec testing suite 2015-01-24 16:37:17 +00:00
Roland Walker a146a1c313 Merge pull request #8721 from rolandwalker/integrate_download_strategy
partial merge of homebrew-fork download_strategy
2015-01-07 18:19:12 -05: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 526c8c08e7 cleaner way to allow spec test to run
without creating unwanted directories
2015-01-07 09:06:06 -05:00
Roland Walker 9deef47e2e partial merge of homebrew-fork download_strategy
merge module Hbc::DownloadStrategy and class Hbc::HbAbstractDownloadStrategy
into class Hbc::AbstractDownloadStrategy
2015-01-07 05:34:03 -05:00
Roland Walker ef3d7c90d4 remove homebrew-fork resource.rb
* Most of what the Resource class does, we do (or can easily do) with
[`url.rb`](https://github.com/caskroom/homebrew-cask/blob/remove_homebrew_fork_resource/lib/hbc/url.rb)
* adjust our download_strategy.rb to compensate
* adjust homebrew-fork download_strategy.rb to compensate
* add parentheses in homebrew-fork download_strategy.rb
2015-01-02 09:43:14 -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 13391af9a9 Merge pull request #8318 from rolandwalker/explicit_ruby_2_requirement
explicitly require Ruby 2.0 at all entry points
2014-12-22 07:20:00 -05:00
Roland Walker 0bdc8cf99e actually require all required stanzas
* audit tests match the documentation
* require `license`
* require at least one activatable artifact (or explicit `stage_only`)
2014-12-20 11:34:49 -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 dd8aa7904d require mocha/api for RSpec tests
to be removed from Homebrew-fork
2014-12-19 10:30:14 -05:00
Roland Walker 1413bea1c0 `sha256 :no_check` overrides `version <string>`
This behavior was traditionally present, and is now recovered
by removing the audit test added in #4743.  The doc is clarified
but did not require major change.

closes: #6356
refs: #8179
2014-12-17 08:21:51 -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
Roland Walker 6f759e07ae disable test which writes outside test dir
invoking Cask.init attempts to actually `mkdir /custom/caskdir`
2014-12-11 10:49:45 -05:00
Roland Walker a6bc35cfa8 remove support for `title` method in Casks
obsoleted by `token`
2014-12-05 18:41:24 -05:00
Roland Walker a335d3b06d unify and recast "Cask name" & "title" as "token"
* "Canonical App Name" becomes "Simplified App Name"
* devscript `cask_namer` renamed to `generate_cask_token`
* doc file `CASK_NAMING_REFERENCE.md` renamed to `cask_token_reference.md`
* DSL uses `"#{token}"` for interpolation instead of `"#{title}"`
* documentation text
* backend code (variables, method, class names)
* error message text
* tests
* code comments
* Cask comments
* emphasize `tags :name`
* doc: use "vendor" consistently instead of "developer"
* doc: many man page argument descriptions were incorrect
* incidental clarifications

Many backend variables similar to `cask_name` or `cask` have
been standardized to `cask_token`, `token`, etc, resolving a long-
standing ambiguity in which variables named `cask` might contain
a Cask instance or a string token.

In many places the docs could be shortened from "Cask name" to
simply "token", which is desirable because we use the term "Cask"
in too many contexts.
2014-12-01 11:00:23 -05: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 6d82c9770e change docs/tests to use version :latest
Instead of version 'latest' (value as string).  The string
value is still permitted during a transitional period.
2014-09-17 07:22:33 -04:00
Paul Hinze 63a32ef021 rspecify scopes and download strategy tests
refs #5080
2014-06-29 14:56:47 -05:00
Paul Hinze 58d4c745a9 install rspec; move first few tests over
refs #5080
2014-06-29 11:33:22 -05:00
phinze cd70474aa9 moving back from spec/ -> test/
since various tooling keeps guessing we're using rspec
2012-10-13 15:24:45 -05:00
phinze 33bd190694 convert vendored homebrew into a submodule 2012-10-13 14:47:19 -05:00
phinze f1932a4d8c OMG a test suite!
Just getting started of course, but this piggy backs on Homebrew's
testing strategy to give us a platform for a fully featured test suite.
Neato!

And the tests provide value right away, as I added some better error
handling to `Cask.load`.

Big things ahead. Just you wait.
2012-10-13 14:39:00 -05:00