sus 0.35.2 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 38873e75813a38f0b6a1d95006cf285ad40deabf372ea4dd6014e0ab41d994a9
4
- data.tar.gz: 9d9bb3cbf3dc3eaba78d5ebe4880f3cef862cffbbb50f7760e27a994776c2ed4
3
+ metadata.gz: f8e0db7c132f0bf73f74ed8e0def2d4e53d41d48133f8cd3183c18fa530ec847
4
+ data.tar.gz: f0e3c8b30d700ed917d2a74a81837f21278c4f45fdc3271a7a9213a0dd631895
5
5
  SHA512:
6
- metadata.gz: 3e6bc26c14aaf3be9b3232eda519a47fa05b659ff4baf501da3c830548ead2e4125ab0e37c7a28693fd5fce93fd0aa122ea09ce3843a939170de4f1726f6decd
7
- data.tar.gz: 100146d5119b3bdff4cfb924173385338dfba86ea1d65f11bd5270422d872185532c59857971e14afeeea2d0212e02d44b7449b1dedd1318030d1e5e41524a04
6
+ metadata.gz: 0f5d22b2d3548fef4d43afeea24fa74a2c47fa99d6640b7db4c0b6af00ecd07cdcb52303c4d3276fc32d4e62e7ae045eeffbbef54c379bd0f21f207e820b9aef
7
+ data.tar.gz: 8b1485cee341ba0b8083bda0c5da868f97f68002657f051d977b590fbb4e1bf7a97e9fa816c6949961740b39704de507e003e5c6dc6c213b6791f7ebdc7d53dc
checksums.yaml.gz.sig CHANGED
Binary file
@@ -108,7 +108,7 @@ Use `describe` to group related tests:
108
108
  ```ruby
109
109
  describe MyThing do
110
110
  # The subject will be whatever is described:
111
- let(:my_thing) {subject.new}
111
+ let(:my_thing){subject.new}
112
112
  end
113
113
  ```
114
114
 
data/lib/sus/base.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2024, by Samuel Williams.
4
+ # Copyright, 2021-2026, by Samuel Williams.
5
5
 
6
6
  require_relative "context"
7
7
 
data/lib/sus/be.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2024, by Samuel Williams.
4
+ # Copyright, 2021-2026, by Samuel Williams.
5
5
 
6
6
  module Sus
7
7
  # Represents a predicate matcher that can be used with `expect(...).to be(...)`.
data/lib/sus/be_truthy.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2022-2023, by Samuel Williams.
4
+ # Copyright, 2022-2026, by Samuel Williams.
5
5
 
6
6
  module Sus
7
7
  # Represents a predicate that checks if the subject is truthy.
data/lib/sus/be_within.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2024, by Samuel Williams.
4
+ # Copyright, 2021-2026, by Samuel Williams.
5
5
 
6
6
  module Sus
7
7
  # Represents a predicate that checks if the subject is within a tolerance of a value.
data/lib/sus/clock.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2022-2023, by Samuel Williams.
4
+ # Copyright, 2022-2026, by Samuel Williams.
5
5
 
6
6
  module Sus
7
7
  # Represents a clock for measuring elapsed time during test execution.
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-2025, by Samuel Williams.
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"
data/lib/sus/context.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2024, by Samuel Williams.
4
+ # Copyright, 2021-2026, by Samuel Williams.
5
5
 
6
6
  require_relative "assertions"
7
7
  require_relative "identity"
data/lib/sus/describe.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2024, by Samuel Williams.
4
+ # Copyright, 2021-2026, by Samuel Williams.
5
5
 
6
6
  require_relative "context"
7
7
 
data/lib/sus/expect.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2024, by Samuel Williams.
4
+ # Copyright, 2021-2026, by Samuel Williams.
5
5
 
6
6
  module Sus
7
7
  # Represents an expectation that can be used with predicates to make assertions.
data/lib/sus/file.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2024, by Samuel Williams.
4
+ # Copyright, 2021-2026, by Samuel Williams.
5
5
  # Copyright, 2022, by Brad Schrag.
6
6
 
7
7
  require_relative "context"
data/lib/sus/filter.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2024, by Samuel Williams.
4
+ # Copyright, 2021-2026, by Samuel Williams.
5
5
 
6
6
  module Sus
7
7
  # Provides a way to filter the registry according to the suffix on loaded paths.
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2024, by Samuel Williams.
4
+ # Copyright, 2025-2026, by Samuel Williams.
5
5
 
6
6
  require "tmpdir"
7
7
 
data/lib/sus/fixtures.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2022, by Samuel Williams.
4
+ # Copyright, 2022-2026, by Samuel Williams.
5
5
 
6
6
  module Sus
7
7
  # @namespace
data/lib/sus/have/all.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2022, by Samuel Williams.
4
+ # Copyright, 2022-2026, by Samuel Williams.
5
5
 
6
6
  module Sus
7
7
  module Have
data/lib/sus/have/any.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2022, by Samuel Williams.
4
+ # Copyright, 2022-2026, by Samuel Williams.
5
5
 
6
6
  module Sus
7
7
  module Have
data/lib/sus/have.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2022-2024, by Samuel Williams.
4
+ # Copyright, 2022-2026, by Samuel Williams.
5
5
 
6
6
  require_relative "have/all"
7
7
  require_relative "have/any"
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2024, by Samuel Williams.
4
+ # Copyright, 2021-2026, by Samuel Williams.
5
5
 
6
6
  module Sus
7
7
  # Represents a predicate that measures the duration of a block execution.
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-2024, by Samuel Williams.
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.
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2023, by Samuel Williams.
4
+ # Copyright, 2023-2026, by Samuel Williams.
5
5
 
6
6
  module Sus
7
7
  # @namespace
data/lib/sus/it.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2024, by Samuel Williams.
4
+ # Copyright, 2021-2026, by Samuel Williams.
5
5
 
6
6
  require_relative "context"
7
7
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2024, by Samuel Williams.
4
+ # Copyright, 2021-2026, by Samuel Williams.
5
5
 
6
6
  require_relative "context"
7
7
 
data/lib/sus/let.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2024, by Samuel Williams.
4
+ # Copyright, 2021-2026, by Samuel Williams.
5
5
 
6
6
  require_relative "context"
7
7
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2022-2024, by Samuel Williams.
4
+ # Copyright, 2022-2026, by Samuel Williams.
5
5
 
6
6
  module Sus
7
7
  module Output
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2022, by Samuel Williams.
4
+ # Copyright, 2021-2026, by Samuel Williams.
5
5
 
6
6
  module Sus
7
7
  module Output
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2024, by Samuel Williams.
4
+ # Copyright, 2021-2026, by Samuel Williams.
5
5
 
6
6
  require "io/console"
7
7
  require "stringio"
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2024, by Samuel Williams.
4
+ # Copyright, 2021-2026, by Samuel Williams.
5
5
 
6
6
  require "io/console"
7
7
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2024, by Samuel Williams.
4
+ # Copyright, 2021-2026, by Samuel Williams.
5
5
 
6
6
  require_relative "bar"
7
7
  require_relative "status"
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2024, by Samuel Williams.
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(:blue)
14
- output[:busy] ||= output.style(:orange)
13
+ output[:free] ||= output.style(:green)
14
+ output[:busy] ||= output.style(:blue)
15
15
  end
16
16
 
17
17
  # Initialize a new Status indicator.
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2023-2024, by Samuel Williams.
4
+ # Copyright, 2023-2026, by Samuel Williams.
5
5
 
6
6
  require_relative "null"
7
7
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2024, by Samuel Williams.
4
+ # Copyright, 2021-2026, by Samuel Williams.
5
5
 
6
6
  require_relative "messages"
7
7
  require_relative "buffered"
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2024, by Samuel Williams.
4
+ # Copyright, 2021-2026, by Samuel Williams.
5
5
 
6
6
  require "io/console"
7
7
 
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-2024, by Samuel Williams.
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
- # @returns [XTerm, Text] An XTerm handler if the IO is a TTY, otherwise a Text handler.
19
- def self.for(io)
20
- if io.isatty
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
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2024, by Samuel Williams.
4
+ # Copyright, 2021-2026, by Samuel Williams.
5
5
 
6
6
  module Sus
7
7
  # Represents a predicate that checks if a block raises an exception.
data/lib/sus/registry.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2024, by Samuel Williams.
4
+ # Copyright, 2021-2026, by Samuel Williams.
5
5
  # Copyright, 2022, by Brad Schrag.
6
6
 
7
7
  require_relative "base"
data/lib/sus/shared.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2024, by Samuel Williams.
4
+ # Copyright, 2021-2026, by Samuel Williams.
5
5
 
6
6
  require_relative "context"
7
7
 
data/lib/sus/tree.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2023, by Samuel Williams.
4
+ # Copyright, 2023-2026, by Samuel Williams.
5
5
 
6
6
  module Sus
7
7
  # Represents a tree structure of test contexts.
data/lib/sus/version.rb CHANGED
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2025, by Samuel Williams.
4
+ # Copyright, 2021-2026, by Samuel Williams.
5
5
 
6
6
  # @namespace
7
7
  module Sus
8
- VERSION = "0.35.2"
8
+ VERSION = "0.36.0"
9
9
  end
data/lib/sus/with.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2021-2024, by Samuel Williams.
4
+ # Copyright, 2021-2026, by Samuel Williams.
5
5
 
6
6
  require_relative "context"
7
7
 
data/license.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # MIT License
2
2
 
3
- Copyright, 2021-2025, by Samuel Williams.
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
@@ -1,5 +1,9 @@
1
1
  # Releases
2
2
 
3
+ ## v0.36.0
4
+
5
+ - Hard code `XTerm` output for GitHub Actions, as it supports ANSI escape codes.
6
+
3
7
  ## v0.35.0
4
8
 
5
9
  - Add `Sus::Fixtures::TemporaryDirectoryContext`.
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.35.2
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.2'
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.3
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