Skip to content

Commit 3493cec

Browse files
authored
Merge pull request #14 from offerzen/fix/rspec-output
formats output better
2 parents 4c29721 + 18eb487 commit 3493cec

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
safe_commit (0.1.0)
4+
safe_commit (1.0.2)
55
colorize
66
dotenv
77
rubocop (~> 1.21)

lib/safe_commit.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,16 @@ def suggest_refactors
119119
private
120120

121121
def run_rspec(test_filenames)
122-
rspec_command = "./bin/rspec #{test_filenames.join(" ")} --format documentation"
122+
rspec_command = "./bin/rspec #{test_filenames.join(" ")} --format progress --profile 0"
123+
puts "\t#{rspec_command}".colorize(:green)
123124
output, = Open3.capture2(rspec_command)
124125
output
125126
end
126127

127128
def extract_failed_tests_count(rspec_output)
128-
test_results = rspec_output.split("\n").select { |element| element.match(/\d+ examples?, \d+ failures?, \d+ pending/) }
129-
puts test_results
129+
test_results = rspec_output.split("\n").select { |element| element.match(/\d+ examples?, \d+ failures?(, \d+ pending)?/) }
130+
131+
puts "\n\t#{test_results}".colorize(:yellow)
130132
return "ERROR tests fail" if test_results[0].nil?
131133

132134
test_results[0].match(/(?<fails>\d+ failures?)/)[:fails]

lib/safe_commit/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module SafeCommit
4-
VERSION = "0.1.0"
4+
VERSION = "1.0.2"
55
end

0 commit comments

Comments
 (0)