15 Commits

Author SHA1 Message Date
Issy Long
e1383c2898
utils/git_spec: Make example files easier to reason about
- Give the files real names, like `README.md`, rather than having to
  parse the difference between "bleh" and "blah" when reading the tests.
2020-07-14 00:18:45 +01:00
Issy Long
981726c088
utils/git_spec: Add a test for last_revision_commit_of_files
- This method, called from `brew extract` in the case of extraction from
  third-party taps, was untested. This led to it breaking when we refactored
  some of it to appease Sorbet (see PR 7933). If I make the same
  (flawed) change here and run these tests, they fail.
- There's a fair bit going on here, but most of it is setup for
  committing changes to more files, as we're testing operations on
  multiple files in a Homebrew repo.
- I originally tried to write tests for `brew extract`, but that
  required _a lot_ of refactoring because those tests (and their helper
  methods) aren't designed for third-party taps - they rely on
  `CoreTap`. So testing the underlying method is a better solution.
2020-07-14 00:18:44 +01:00
Mike McQuaid
c4f72312ce
Fixup brew style failures. 2019-04-30 09:19:18 +01:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
5e1806e796 test: rubocop-rspec style auto-corrects.
There’s too many warnings to start enabling `rubocop-rspec` by default
but let’s at least apply the cleanups it does automatically.
2018-03-25 13:30:37 +01:00
Maxim Belkin
f984701c29
append ? to git_remote_exist 2018-03-14 16:30:45 -05:00
Viktor Szakats
a6d1ddf326 git_spec.rb: use HTTPS for Git remote test 2017-09-07 08:02:05 +00:00
mansimarkaur
784250d550 Used already existing clear_git_available_cache to remove @git 2017-08-29 22:53:10 +05:30
mansimarkaur
c695dffd37 Added clear git version cache method 2017-08-27 01:23:32 +05:30
mansimarkaur
372a422305 Added tests for ensure_git_installed when git is available or homebrew/core is unavailable 2017-08-27 01:23:32 +05:30
mansimarkaur
abe78ebb8e Removed shutup 2017-08-27 01:23:32 +05:30
mansimarkaur
4f0f55a774 Used system command to run git commands 2017-08-27 01:23:32 +05:30
mansimarkaur
660617a35b Added tests for Utils 2017-08-27 01:23:32 +05:30
mansimarkaur
657b6ef7fb Added tests for git_available? 2017-08-27 01:23:32 +05:30
mansimarkaur
d91036e891 Added tests for last_revision_commit_of_file 2017-08-27 01:23:32 +05:30