Skip to content

Commit e8ea2be

Browse files
authored
Merge pull request #1547 from Homebrew/utils_output
2 parents 1ce7344 + 099ab32 commit e8ea2be

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-0
lines changed

Brewfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
brew "ruby", version_file: ".ruby-version"

bin/rspec

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
#
5+
# This file was generated by Bundler.
6+
#
7+
# The application 'rspec' is installed as part of a gem, and
8+
# this file is here to facilitate running it.
9+
#
10+
11+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12+
13+
bundle_binstub = File.expand_path("bundle", __dir__)
14+
15+
if File.file?(bundle_binstub)
16+
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
17+
load(bundle_binstub)
18+
else
19+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21+
end
22+
end
23+
24+
require "rubygems"
25+
require "bundler/setup"
26+
27+
load Gem.bin_path("rspec-core", "rspec")

lib/test.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
# frozen_string_literal: true
33

44
require "utils/analytics"
5+
require "utils/output"
56

67
module Homebrew
78
class Test
9+
include Utils::Output::Mixin
10+
811
def failed_steps
912
@steps.select(&:failed?)
1013
end

spec/stub/utils/output.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# frozen_string_literal: true
2+
3+
# Intentionally empty for no-op require.
4+
5+
module Utils
6+
module Output
7+
module Mixin
8+
end
9+
end
10+
end

0 commit comments

Comments
 (0)