sus 0.35.1 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/context/getting-started.md +1 -1
- data/lib/sus/base.rb +1 -1
- data/lib/sus/be.rb +1 -1
- data/lib/sus/be_truthy.rb +1 -1
- data/lib/sus/be_within.rb +1 -1
- data/lib/sus/clock.rb +1 -1
- data/lib/sus/config.rb +14 -6
- data/lib/sus/context.rb +1 -1
- data/lib/sus/describe.rb +1 -1
- data/lib/sus/expect.rb +1 -1
- data/lib/sus/file.rb +1 -1
- data/lib/sus/filter.rb +1 -1
- data/lib/sus/fixtures/temporary_directory_context.rb +1 -1
- data/lib/sus/fixtures.rb +1 -1
- data/lib/sus/have/all.rb +1 -1
- data/lib/sus/have/any.rb +1 -1
- data/lib/sus/have.rb +1 -1
- data/lib/sus/have_duration.rb +1 -1
- data/lib/sus/identity.rb +1 -1
- data/lib/sus/integrations.rb +1 -1
- data/lib/sus/it.rb +1 -1
- data/lib/sus/it_behaves_like.rb +1 -1
- data/lib/sus/let.rb +1 -1
- data/lib/sus/output/backtrace.rb +1 -1
- data/lib/sus/output/bar.rb +1 -1
- data/lib/sus/output/buffered.rb +1 -1
- data/lib/sus/output/lines.rb +1 -1
- data/lib/sus/output/progress.rb +1 -1
- data/lib/sus/output/status.rb +3 -3
- data/lib/sus/output/structured.rb +1 -1
- data/lib/sus/output/text.rb +1 -1
- data/lib/sus/output/xterm.rb +1 -1
- data/lib/sus/output.rb +15 -6
- data/lib/sus/raise_exception.rb +1 -1
- data/lib/sus/registry.rb +1 -1
- data/lib/sus/shared.rb +1 -1
- data/lib/sus/tree.rb +1 -1
- data/lib/sus/version.rb +2 -2
- data/lib/sus/with.rb +1 -1
- data/license.md +2 -1
- data/readme.md +20 -0
- data/releases.md +4 -0
- data.tar.gz.sig +0 -0
- metadata +4 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f8e0db7c132f0bf73f74ed8e0def2d4e53d41d48133f8cd3183c18fa530ec847
|
|
4
|
+
data.tar.gz: f0e3c8b30d700ed917d2a74a81837f21278c4f45fdc3271a7a9213a0dd631895
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0f5d22b2d3548fef4d43afeea24fa74a2c47fa99d6640b7db4c0b6af00ecd07cdcb52303c4d3276fc32d4e62e7ae045eeffbbef54c379bd0f21f207e820b9aef
|
|
7
|
+
data.tar.gz: 8b1485cee341ba0b8083bda0c5da868f97f68002657f051d977b590fbb4e1bf7a97e9fa816c6949961740b39704de507e003e5c6dc6c213b6791f7ebdc7d53dc
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/context/getting-started.md
CHANGED
data/lib/sus/base.rb
CHANGED
data/lib/sus/be.rb
CHANGED
data/lib/sus/be_truthy.rb
CHANGED
data/lib/sus/be_within.rb
CHANGED
data/lib/sus/clock.rb
CHANGED
data/lib/sus/config.rb
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
# Released under the MIT License.
|
|
4
|
-
# Copyright, 2022-
|
|
4
|
+
# Copyright, 2022-2026, by Samuel Williams.
|
|
5
|
+
# Copyright, 2026, by William T. Nelson.
|
|
5
6
|
|
|
6
7
|
require_relative "clock"
|
|
7
8
|
require_relative "registry"
|
|
@@ -168,11 +169,14 @@ module Sus
|
|
|
168
169
|
|
|
169
170
|
print_finished_statistics(output, assertions)
|
|
170
171
|
|
|
171
|
-
|
|
172
|
-
|
|
172
|
+
unless assertions.count.zero?
|
|
173
|
+
if !partial? and assertions.passed?
|
|
174
|
+
print_test_feedback(output, assertions)
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
print_slow_tests(output, assertions)
|
|
173
178
|
end
|
|
174
179
|
|
|
175
|
-
print_slow_tests(output, assertions)
|
|
176
180
|
print_failed_assertions(output, assertions)
|
|
177
181
|
end
|
|
178
182
|
|
|
@@ -181,9 +185,13 @@ module Sus
|
|
|
181
185
|
# @parameter assertions [Assertions] The assertions instance.
|
|
182
186
|
def print_finished_statistics(output, assertions)
|
|
183
187
|
duration = @clock.duration
|
|
184
|
-
rate = assertions.count / duration
|
|
185
188
|
|
|
186
|
-
|
|
189
|
+
if assertions.count.zero?
|
|
190
|
+
output.puts "🏴 Finished in ", @clock, "."
|
|
191
|
+
else
|
|
192
|
+
rate = assertions.count / duration
|
|
193
|
+
output.puts "🏁 Finished in ", @clock, "; #{rate.round(3)} assertions per second."
|
|
194
|
+
end
|
|
187
195
|
end
|
|
188
196
|
|
|
189
197
|
# Print feedback about the test suite.
|
data/lib/sus/context.rb
CHANGED
data/lib/sus/describe.rb
CHANGED
data/lib/sus/expect.rb
CHANGED
data/lib/sus/file.rb
CHANGED
data/lib/sus/filter.rb
CHANGED
data/lib/sus/fixtures.rb
CHANGED
data/lib/sus/have/all.rb
CHANGED
data/lib/sus/have/any.rb
CHANGED
data/lib/sus/have.rb
CHANGED
data/lib/sus/have_duration.rb
CHANGED
data/lib/sus/identity.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
# Released under the MIT License.
|
|
4
|
-
# Copyright, 2021-
|
|
4
|
+
# Copyright, 2021-2026, by Samuel Williams.
|
|
5
5
|
|
|
6
6
|
module Sus
|
|
7
7
|
# Represents a unique identity for a test or context, used for identification and location tracking.
|
data/lib/sus/integrations.rb
CHANGED
data/lib/sus/it.rb
CHANGED
data/lib/sus/it_behaves_like.rb
CHANGED
data/lib/sus/let.rb
CHANGED
data/lib/sus/output/backtrace.rb
CHANGED
data/lib/sus/output/bar.rb
CHANGED
data/lib/sus/output/buffered.rb
CHANGED
data/lib/sus/output/lines.rb
CHANGED
data/lib/sus/output/progress.rb
CHANGED
data/lib/sus/output/status.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
# Released under the MIT License.
|
|
4
|
-
# Copyright, 2021-
|
|
4
|
+
# Copyright, 2021-2026, by Samuel Williams.
|
|
5
5
|
|
|
6
6
|
module Sus
|
|
7
7
|
module Output
|
|
@@ -10,8 +10,8 @@ module Sus
|
|
|
10
10
|
# Register status styling with an output handler.
|
|
11
11
|
# @parameter output [Output] The output handler to register with.
|
|
12
12
|
def self.register(output)
|
|
13
|
-
output[:free] ||= output.style(:
|
|
14
|
-
output[:busy] ||= output.style(:
|
|
13
|
+
output[:free] ||= output.style(:green)
|
|
14
|
+
output[:busy] ||= output.style(:blue)
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
# Initialize a new Status indicator.
|
data/lib/sus/output/text.rb
CHANGED
data/lib/sus/output/xterm.rb
CHANGED
data/lib/sus/output.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
# Released under the MIT License.
|
|
4
|
-
# Copyright, 2021-
|
|
4
|
+
# Copyright, 2021-2026, by Samuel Williams.
|
|
5
5
|
|
|
6
6
|
require_relative "output/bar"
|
|
7
7
|
require_relative "output/text"
|
|
@@ -13,11 +13,19 @@ require_relative "output/progress"
|
|
|
13
13
|
module Sus
|
|
14
14
|
# Represents output handlers for test results and messages.
|
|
15
15
|
module Output
|
|
16
|
+
# Detect if we're running in GitHub Actions, where human-readable output is preferred.
|
|
17
|
+
# GitHub Actions sets the GITHUB_ACTIONS environment variable to "true".
|
|
18
|
+
# @parameter env [Hash] The environment variables to check.
|
|
19
|
+
def self.github_actions?(env)
|
|
20
|
+
env["GITHUB_ACTIONS"] == "true"
|
|
21
|
+
end
|
|
22
|
+
|
|
16
23
|
# Create an appropriate output handler for the given IO.
|
|
17
24
|
# @parameter io [IO] The IO object to write to.
|
|
18
|
-
# @
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
# @parameter env [Hash] The environment variables to consider (defaults to ENV).
|
|
26
|
+
# @returns [XTerm, Text] An XTerm handler if the IO is a TTY or running in GitHub Actions, otherwise a Text handler.
|
|
27
|
+
def self.for(io, env = ENV)
|
|
28
|
+
if io.isatty or self.github_actions?(env)
|
|
21
29
|
XTerm.new(io)
|
|
22
30
|
else
|
|
23
31
|
Text.new(io)
|
|
@@ -26,9 +34,10 @@ module Sus
|
|
|
26
34
|
|
|
27
35
|
# Create a default output handler with styling configured.
|
|
28
36
|
# @parameter io [IO] The IO object to write to (defaults to $stderr).
|
|
37
|
+
# @parameter env [Hash] The environment variables to consider (defaults to ENV).
|
|
29
38
|
# @returns [XTerm, Text] A configured output handler.
|
|
30
|
-
def self.default(io = $stderr)
|
|
31
|
-
output = self.for(io)
|
|
39
|
+
def self.default(io = $stderr, env = ENV)
|
|
40
|
+
output = self.for(io, env)
|
|
32
41
|
|
|
33
42
|
Output::Bar.register(output)
|
|
34
43
|
|
data/lib/sus/raise_exception.rb
CHANGED
data/lib/sus/registry.rb
CHANGED
data/lib/sus/shared.rb
CHANGED
data/lib/sus/tree.rb
CHANGED
data/lib/sus/version.rb
CHANGED
data/lib/sus/with.rb
CHANGED
data/license.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# MIT License
|
|
2
2
|
|
|
3
|
-
Copyright, 2021-
|
|
3
|
+
Copyright, 2021-2026, by Samuel Williams.
|
|
4
4
|
Copyright, 2022, by Brad Schrag.
|
|
5
|
+
Copyright, 2026, by William T. Nelson.
|
|
5
6
|
|
|
6
7
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
8
|
of this software and associated documentation files (the "Software"), to deal
|
data/readme.md
CHANGED
|
@@ -33,6 +33,10 @@ Please see the [project documentation](https://socketry.github.io/sus/) for more
|
|
|
33
33
|
|
|
34
34
|
Please see the [project releases](https://socketry.github.io/sus/releases/index) for all releases.
|
|
35
35
|
|
|
36
|
+
### v0.36.0
|
|
37
|
+
|
|
38
|
+
- Hard code `XTerm` output for GitHub Actions, as it supports ANSI escape codes.
|
|
39
|
+
|
|
36
40
|
### v0.35.0
|
|
37
41
|
|
|
38
42
|
- Add `Sus::Fixtures::TemporaryDirectoryContext`.
|
|
@@ -64,6 +68,22 @@ We welcome contributions to this project.
|
|
|
64
68
|
4. Push to the branch (`git push origin my-new-feature`).
|
|
65
69
|
5. Create new Pull Request.
|
|
66
70
|
|
|
71
|
+
### Running Tests
|
|
72
|
+
|
|
73
|
+
To run the test suite:
|
|
74
|
+
|
|
75
|
+
``` shell
|
|
76
|
+
bundle exec sus
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Making Releases
|
|
80
|
+
|
|
81
|
+
To make a new release:
|
|
82
|
+
|
|
83
|
+
``` shell
|
|
84
|
+
bundle exec bake gem:release:patch # or minor or major
|
|
85
|
+
```
|
|
86
|
+
|
|
67
87
|
### Developer Certificate of Origin
|
|
68
88
|
|
|
69
89
|
In order to protect users of this project, we require all contributors to comply with the [Developer Certificate of Origin](https://developercertificate.org/). This ensures that all contributions are properly licensed and attributed.
|
data/releases.md
CHANGED
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sus
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.36.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Samuel Williams
|
|
8
8
|
- Brad Schrag
|
|
9
|
+
- William T. Nelson
|
|
9
10
|
bindir: bin
|
|
10
11
|
cert_chain:
|
|
11
12
|
- |
|
|
@@ -118,14 +119,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
118
119
|
requirements:
|
|
119
120
|
- - ">="
|
|
120
121
|
- !ruby/object:Gem::Version
|
|
121
|
-
version: '3.
|
|
122
|
+
version: '3.3'
|
|
122
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
124
|
requirements:
|
|
124
125
|
- - ">="
|
|
125
126
|
- !ruby/object:Gem::Version
|
|
126
127
|
version: '0'
|
|
127
128
|
requirements: []
|
|
128
|
-
rubygems_version: 4.0.
|
|
129
|
+
rubygems_version: 4.0.6
|
|
129
130
|
specification_version: 4
|
|
130
131
|
summary: A fast and scalable test runner.
|
|
131
132
|
test_files: []
|
metadata.gz.sig
CHANGED
|
Binary file
|