sus 0.31.0 → 0.33.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/bin/sus +2 -10
- data/bin/sus-host +6 -6
- data/bin/sus-parallel +4 -4
- data/bin/sus-tree +3 -3
- data/lib/sus/assertions.rb +3 -3
- data/lib/sus/base.rb +2 -2
- data/lib/sus/config.rb +12 -6
- data/lib/sus/context.rb +2 -2
- data/lib/sus/describe.rb +2 -2
- data/lib/sus/file.rb +2 -2
- data/lib/sus/filter.rb +2 -2
- data/lib/sus/have.rb +2 -2
- data/lib/sus/identity.rb +2 -2
- data/lib/sus/include_context.rb +1 -1
- data/lib/sus/it.rb +1 -1
- data/lib/sus/it_behaves_like.rb +1 -1
- data/lib/sus/let.rb +2 -2
- data/lib/sus/mock.rb +1 -1
- data/lib/sus/output/buffered.rb +3 -3
- data/lib/sus/output/lines.rb +2 -2
- data/lib/sus/output/null.rb +2 -2
- data/lib/sus/output/progress.rb +4 -4
- data/lib/sus/output/status.rb +3 -3
- data/lib/sus/output/structured.rb +2 -2
- data/lib/sus/output/text.rb +2 -2
- data/lib/sus/output/xterm.rb +3 -3
- data/lib/sus/output.rb +6 -6
- data/lib/sus/receive.rb +31 -17
- data/lib/sus/registry.rb +10 -10
- data/lib/sus/shared.rb +1 -1
- data/lib/sus/version.rb +1 -1
- data/lib/sus/with.rb +2 -2
- data/lib/sus.rb +16 -16
- data/readme.md +21 -8
- data/releases.md +24 -0
- data.tar.gz.sig +0 -0
- metadata +5 -9
- metadata.gz.sig +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db29c44268893d062be3e45b5719a6dbc19e262f35176dd0c42d94cb2353d799
|
4
|
+
data.tar.gz: 9ec4e241579b44e02c319c96d58556629e58f3d293802abbc162ea0d503788d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a21e37fc13db88ab62f707aced7c459f6db1e12b51b70c872e82274f6fe2f70392dcd3248286dfd5714c02662205e72f4e554a70f23df42a3016d5ca03a585de
|
7
|
+
data.tar.gz: 8076f874b40ee4aab71dbf34c2efc0270a2d0e802a0455503d842935beeca28fa35333939304eee3f54ea06183e3c0bee6667776d66357076ffc6f32ddb59b21
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/bin/sus
CHANGED
@@ -1,13 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
5
|
-
# StackProf.start(mode: :wall, interval: 10)
|
6
|
-
|
7
|
-
require_relative '../lib/sus/config'
|
4
|
+
require_relative "../lib/sus/config"
|
8
5
|
config = Sus::Config.load
|
9
6
|
|
10
|
-
require_relative
|
7
|
+
require_relative "../lib/sus"
|
11
8
|
registry = config.registry
|
12
9
|
|
13
10
|
if config.verbose?
|
@@ -24,11 +21,6 @@ config.before_tests(assertions)
|
|
24
21
|
registry.call(assertions)
|
25
22
|
config.after_tests(assertions)
|
26
23
|
|
27
|
-
# StackProf.stop
|
28
|
-
# StackProf.results('sus.stackprof')
|
29
|
-
#
|
30
|
-
# $ stackprof sus.stackprof --text --limit 10
|
31
|
-
|
32
24
|
unless assertions.passed?
|
33
25
|
exit(1)
|
34
26
|
end
|
data/bin/sus-host
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
require
|
4
|
+
require "json"
|
5
5
|
|
6
|
-
require_relative
|
6
|
+
require_relative "../lib/sus/config"
|
7
7
|
config = Sus::Config.load
|
8
8
|
|
9
|
-
require_relative
|
9
|
+
require_relative "../lib/sus"
|
10
10
|
|
11
11
|
verbose = false
|
12
12
|
guard = Thread::Mutex.new
|
13
13
|
|
14
|
-
require
|
14
|
+
require "etc"
|
15
15
|
count = Etc.nprocessors
|
16
16
|
|
17
17
|
$stdout.sync = true
|
18
18
|
|
19
|
-
require_relative
|
19
|
+
require_relative "../lib/sus/output/structured"
|
20
20
|
|
21
21
|
input = $stdin.dup
|
22
22
|
$stdin.reopen(File::NULL)
|
@@ -36,7 +36,7 @@ end
|
|
36
36
|
while line = input.gets
|
37
37
|
message = JSON.parse(line)
|
38
38
|
|
39
|
-
if tests = message[
|
39
|
+
if tests = message["run"]
|
40
40
|
jobs = Thread::Queue.new
|
41
41
|
results = Thread::Queue.new
|
42
42
|
|
data/bin/sus-parallel
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
require_relative
|
4
|
+
require_relative "../lib/sus/config"
|
5
5
|
config = Sus::Config.load
|
6
6
|
|
7
7
|
Result = Struct.new(:job, :assertions)
|
8
8
|
|
9
|
-
require_relative
|
10
|
-
require_relative
|
9
|
+
require_relative "../lib/sus"
|
10
|
+
require_relative "../lib/sus/output"
|
11
11
|
jobs = Thread::Queue.new
|
12
12
|
results = Thread::Queue.new
|
13
13
|
guard = Thread::Mutex.new
|
14
14
|
progress = Sus::Output::Progress.new(config.output)
|
15
15
|
|
16
|
-
require
|
16
|
+
require "etc"
|
17
17
|
count = Etc.nprocessors
|
18
18
|
|
19
19
|
loader = Thread.new do
|
data/bin/sus-tree
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
require
|
4
|
+
require "json"
|
5
5
|
|
6
|
-
require_relative
|
6
|
+
require_relative "../lib/sus/config"
|
7
7
|
config = Sus::Config.load
|
8
8
|
|
9
|
-
require_relative
|
9
|
+
require_relative "../lib/sus"
|
10
10
|
|
11
11
|
verbose = false
|
12
12
|
registry = config.registry
|
data/lib/sus/assertions.rb
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
# Released under the MIT License.
|
4
4
|
# Copyright, 2021-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
7
|
-
require_relative
|
6
|
+
require_relative "output"
|
7
|
+
require_relative "clock"
|
8
8
|
|
9
|
-
require_relative
|
9
|
+
require_relative "output/backtrace"
|
10
10
|
|
11
11
|
module Sus
|
12
12
|
class Assertions
|
data/lib/sus/base.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2021-
|
4
|
+
# Copyright, 2021-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
6
|
+
require_relative "context"
|
7
7
|
|
8
8
|
module Sus
|
9
9
|
# The base test case class. We need to be careful about what local state is stored.
|
data/lib/sus/config.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2022-
|
4
|
+
# Copyright, 2022-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
7
|
-
require_relative
|
6
|
+
require_relative "clock"
|
7
|
+
require_relative "registry"
|
8
8
|
|
9
9
|
module Sus
|
10
10
|
class Config
|
@@ -28,7 +28,7 @@ module Sus
|
|
28
28
|
end
|
29
29
|
|
30
30
|
options = {
|
31
|
-
verbose: !!arguments.delete(
|
31
|
+
verbose: !!arguments.delete("--verbose")
|
32
32
|
}
|
33
33
|
|
34
34
|
return derived.new(root, arguments, **options)
|
@@ -53,8 +53,8 @@ module Sus
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def add_default_load_paths
|
56
|
-
add_load_path(
|
57
|
-
add_load_path(
|
56
|
+
add_load_path("lib")
|
57
|
+
add_load_path("fixtures")
|
58
58
|
end
|
59
59
|
|
60
60
|
attr :root
|
@@ -103,9 +103,15 @@ module Sus
|
|
103
103
|
@registry ||= self.load_registry
|
104
104
|
end
|
105
105
|
|
106
|
+
def prepare_warnings!
|
107
|
+
Warning[:deprecated] = true
|
108
|
+
end
|
109
|
+
|
106
110
|
def before_tests(assertions, output: self.output)
|
107
111
|
@clock.reset!
|
108
112
|
@clock.start!
|
113
|
+
|
114
|
+
prepare_warnings!
|
109
115
|
end
|
110
116
|
|
111
117
|
def after_tests(assertions, output: self.output)
|
data/lib/sus/context.rb
CHANGED
data/lib/sus/describe.rb
CHANGED
data/lib/sus/file.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2021-
|
4
|
+
# Copyright, 2021-2024, by Samuel Williams.
|
5
5
|
# Copyright, 2022, by Brad Schrag.
|
6
6
|
|
7
|
-
require_relative
|
7
|
+
require_relative "context"
|
8
8
|
|
9
9
|
# This has to be done at the top level. It allows us to define constants within the given class while still retaining top-level constant resolution.
|
10
10
|
Sus::TOPLEVEL_CLASS_EVAL = ->(__klass__, __path__){__klass__.class_eval(::File.read(__path__), __path__)}
|
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-
|
4
|
+
# Copyright, 2021-2024, 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.
|
@@ -48,7 +48,7 @@ module Sus
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def load(target)
|
51
|
-
path, filter = target.split(
|
51
|
+
path, filter = target.split(":", 2)
|
52
52
|
|
53
53
|
@registry.load(path)
|
54
54
|
|
data/lib/sus/have.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-2024, by Samuel Williams.
|
5
5
|
|
6
6
|
module Sus
|
7
7
|
class Identity
|
@@ -82,7 +82,7 @@ module Sus
|
|
82
82
|
# For a specific leaf node, the last part is not unique, i.e. it must be identified explicitly.
|
83
83
|
append_unique_key(key, @unique == true ? false : @unique)
|
84
84
|
|
85
|
-
@key = key.join(
|
85
|
+
@key = key.join(":")
|
86
86
|
end
|
87
87
|
|
88
88
|
return @key
|
data/lib/sus/include_context.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/mock.rb
CHANGED
data/lib/sus/output/buffered.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2021-
|
4
|
+
# Copyright, 2021-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require
|
7
|
-
require
|
6
|
+
require "io/console"
|
7
|
+
require "stringio"
|
8
8
|
|
9
9
|
module Sus
|
10
10
|
# Styled output output.
|
data/lib/sus/output/lines.rb
CHANGED
data/lib/sus/output/null.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2021-
|
4
|
+
# Copyright, 2021-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
6
|
+
require_relative "messages"
|
7
7
|
|
8
8
|
module Sus
|
9
9
|
# Styled output output.
|
data/lib/sus/output/progress.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2021-
|
4
|
+
# Copyright, 2021-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
7
|
-
require_relative
|
8
|
-
require_relative
|
6
|
+
require_relative "bar"
|
7
|
+
require_relative "status"
|
8
|
+
require_relative "lines"
|
9
9
|
|
10
10
|
module Sus
|
11
11
|
module Output
|
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-2024, by Samuel Williams.
|
5
5
|
|
6
6
|
module Sus
|
7
7
|
module Output
|
@@ -17,8 +17,8 @@ module Sus
|
|
17
17
|
end
|
18
18
|
|
19
19
|
INDICATORS = {
|
20
|
-
busy: [
|
21
|
-
free: [
|
20
|
+
busy: ["◑", "◒", "◐", "◓"],
|
21
|
+
free: ["◌"]
|
22
22
|
}
|
23
23
|
|
24
24
|
def update(state, context = nil)
|
data/lib/sus/output/text.rb
CHANGED
data/lib/sus/output/xterm.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2021-
|
4
|
+
# Copyright, 2021-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require
|
6
|
+
require "io/console"
|
7
7
|
|
8
|
-
require_relative
|
8
|
+
require_relative "text"
|
9
9
|
|
10
10
|
module Sus
|
11
11
|
# Styled output output.
|
data/lib/sus/output.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2021-
|
4
|
+
# Copyright, 2021-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
7
|
-
require_relative
|
8
|
-
require_relative
|
6
|
+
require_relative "output/bar"
|
7
|
+
require_relative "output/text"
|
8
|
+
require_relative "output/xterm"
|
9
9
|
|
10
|
-
require_relative
|
11
|
-
require_relative
|
10
|
+
require_relative "output/null"
|
11
|
+
require_relative "output/progress"
|
12
12
|
|
13
13
|
module Sus
|
14
14
|
module Output
|
data/lib/sus/receive.rb
CHANGED
@@ -3,13 +3,11 @@
|
|
3
3
|
# Released under the MIT License.
|
4
4
|
# Copyright, 2022-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
6
|
+
require_relative "respond_to"
|
7
7
|
|
8
8
|
module Sus
|
9
9
|
class Receive
|
10
|
-
|
11
|
-
|
12
|
-
def initialize(base, method)
|
10
|
+
def initialize(base, method, &block)
|
13
11
|
@base = base
|
14
12
|
@method = method
|
15
13
|
|
@@ -17,7 +15,8 @@ module Sus
|
|
17
15
|
@arguments = nil
|
18
16
|
@options = nil
|
19
17
|
@block = nil
|
20
|
-
|
18
|
+
|
19
|
+
@returning = block
|
21
20
|
end
|
22
21
|
|
23
22
|
def print(output)
|
@@ -60,12 +59,27 @@ module Sus
|
|
60
59
|
return self
|
61
60
|
end
|
62
61
|
|
63
|
-
def and_return(*returning)
|
64
|
-
if
|
65
|
-
|
62
|
+
def and_return(*returning, &block)
|
63
|
+
if block_given?
|
64
|
+
if returning.any?
|
65
|
+
raise ArgumentError, "Cannot specify both a block and returning values."
|
66
|
+
end
|
67
|
+
|
68
|
+
@returning = block
|
69
|
+
elsif returning.size == 1
|
70
|
+
@returning = proc{returning.first}
|
66
71
|
else
|
67
|
-
@returning = returning
|
72
|
+
@returning = proc{returning}
|
73
|
+
end
|
74
|
+
|
75
|
+
return self
|
76
|
+
end
|
77
|
+
|
78
|
+
def and_raise(...)
|
79
|
+
@returning = proc do
|
80
|
+
raise(...)
|
68
81
|
end
|
82
|
+
|
69
83
|
return self
|
70
84
|
end
|
71
85
|
|
@@ -97,7 +111,7 @@ module Sus
|
|
97
111
|
|
98
112
|
validate(mock, assertions, arguments, options, block)
|
99
113
|
|
100
|
-
next @returning
|
114
|
+
next @returning.call(*arguments, **options, &block)
|
101
115
|
end
|
102
116
|
end
|
103
117
|
|
@@ -110,7 +124,7 @@ module Sus
|
|
110
124
|
end
|
111
125
|
|
112
126
|
def call_original?
|
113
|
-
@returning
|
127
|
+
@returning.nil?
|
114
128
|
end
|
115
129
|
|
116
130
|
class WithArguments
|
@@ -128,7 +142,7 @@ module Sus
|
|
128
142
|
end
|
129
143
|
end
|
130
144
|
end
|
131
|
-
|
145
|
+
|
132
146
|
class WithOptions
|
133
147
|
def initialize(predicate)
|
134
148
|
@predicate = predicate
|
@@ -153,7 +167,7 @@ module Sus
|
|
153
167
|
def print(output)
|
154
168
|
output.write("with block", @predicate)
|
155
169
|
end
|
156
|
-
|
170
|
+
|
157
171
|
def call(assertions, subject)
|
158
172
|
assertions.nested(self) do |assertions|
|
159
173
|
|
@@ -161,7 +175,7 @@ module Sus
|
|
161
175
|
end
|
162
176
|
end
|
163
177
|
end
|
164
|
-
|
178
|
+
|
165
179
|
class Times
|
166
180
|
ONCE = Be.new(:==, 1)
|
167
181
|
|
@@ -172,7 +186,7 @@ module Sus
|
|
172
186
|
def print(output)
|
173
187
|
output.write("with call count ", @condition)
|
174
188
|
end
|
175
|
-
|
189
|
+
|
176
190
|
def call(assertions, subject)
|
177
191
|
assertions.nested(self) do |assertions|
|
178
192
|
Expect.new(assertions, subject).to(@condition)
|
@@ -182,8 +196,8 @@ module Sus
|
|
182
196
|
end
|
183
197
|
|
184
198
|
class Base
|
185
|
-
def receive(method)
|
186
|
-
Receive.new(self, method)
|
199
|
+
def receive(method, &block)
|
200
|
+
Receive.new(self, method, &block)
|
187
201
|
end
|
188
202
|
end
|
189
203
|
end
|
data/lib/sus/registry.rb
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2021-
|
4
|
+
# Copyright, 2021-2024, by Samuel Williams.
|
5
5
|
# Copyright, 2022, by Brad Schrag.
|
6
6
|
|
7
|
-
require_relative
|
7
|
+
require_relative "base"
|
8
8
|
|
9
|
-
require_relative
|
10
|
-
require_relative
|
11
|
-
require_relative
|
9
|
+
require_relative "file"
|
10
|
+
require_relative "describe"
|
11
|
+
require_relative "with"
|
12
12
|
|
13
|
-
require_relative
|
13
|
+
require_relative "it"
|
14
14
|
|
15
|
-
require_relative
|
16
|
-
require_relative
|
17
|
-
require_relative
|
15
|
+
require_relative "shared"
|
16
|
+
require_relative "it_behaves_like"
|
17
|
+
require_relative "include_context"
|
18
18
|
|
19
|
-
require_relative
|
19
|
+
require_relative "let"
|
20
20
|
|
21
21
|
module Sus
|
22
22
|
class Registry
|
data/lib/sus/shared.rb
CHANGED
data/lib/sus/version.rb
CHANGED
data/lib/sus/with.rb
CHANGED
data/lib/sus.rb
CHANGED
@@ -1,24 +1,24 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2021-
|
4
|
+
# Copyright, 2021-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
7
|
-
require_relative
|
8
|
-
require_relative
|
9
|
-
require_relative
|
10
|
-
require_relative
|
6
|
+
require_relative "sus/version"
|
7
|
+
require_relative "sus/config"
|
8
|
+
require_relative "sus/registry"
|
9
|
+
require_relative "sus/assertions"
|
10
|
+
require_relative "sus/tree"
|
11
11
|
|
12
|
-
require_relative
|
13
|
-
require_relative
|
14
|
-
require_relative
|
15
|
-
require_relative
|
12
|
+
require_relative "sus/expect"
|
13
|
+
require_relative "sus/be"
|
14
|
+
require_relative "sus/be_truthy"
|
15
|
+
require_relative "sus/be_within"
|
16
16
|
|
17
|
-
require_relative
|
18
|
-
require_relative
|
17
|
+
require_relative "sus/mock"
|
18
|
+
require_relative "sus/receive"
|
19
19
|
|
20
|
-
require_relative
|
21
|
-
require_relative
|
22
|
-
require_relative
|
20
|
+
require_relative "sus/raise_exception"
|
21
|
+
require_relative "sus/have_duration"
|
22
|
+
require_relative "sus/have"
|
23
23
|
|
24
|
-
require_relative
|
24
|
+
require_relative "sus/filter"
|
data/readme.md
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
Sus is a testing framework for Ruby.
|
4
4
|
|
5
|
-
- It's similar to RSpec but with less baggage and more parallelism.
|
6
|
-
- It uses `expect` style syntax with first-class predicates.
|
7
|
-
- It has direct [support for code coverage](https://github.com/socketry/covered).
|
8
|
-
- It supports the [VSCode Test Runner interface](https://github.com/socketry/sus-vscode).
|
9
|
-
- It's based on my experience writing thousands of tests.
|
10
|
-
- It's easy to extend (see the `sus-fixtures-` gems for examples).
|
5
|
+
- It's similar to RSpec but with less baggage and more parallelism.
|
6
|
+
- It uses `expect` style syntax with first-class predicates.
|
7
|
+
- It has direct [support for code coverage](https://github.com/socketry/covered).
|
8
|
+
- It supports the [VSCode Test Runner interface](https://github.com/socketry/sus-vscode).
|
9
|
+
- It's based on my experience writing thousands of tests.
|
10
|
+
- It's easy to extend (see the `sus-fixtures-` gems for examples).
|
11
11
|
|
12
12
|
[](https://github.com/socketry/sus/actions?workflow=Test)
|
13
13
|
|
@@ -15,7 +15,7 @@ Sus is a testing framework for Ruby.
|
|
15
15
|
|
16
16
|
<div align="center">
|
17
17
|
<a href="https://www.youtube.com/watch?v=BDQHgb2rrwU">
|
18
|
-
<img src="https://img.youtube.com/vi/BDQHgb2rrwU/0.jpg" alt="Testing with Sus"
|
18
|
+
<img src="https://img.youtube.com/vi/BDQHgb2rrwU/0.jpg" alt="Testing with Sus"/>
|
19
19
|
</a>
|
20
20
|
</div>
|
21
21
|
|
@@ -25,9 +25,22 @@ Please see the [project documentation](https://socketry.github.io/sus/) for more
|
|
25
25
|
|
26
26
|
- [Getting Started](https://socketry.github.io/sus/guides/getting-started/index) - This guide explains how to use the `sus` gem to write tests for your Ruby projects.
|
27
27
|
|
28
|
+
## Releases
|
29
|
+
|
30
|
+
Please see the [project releases](https://socketry.github.io/sus/releases/index) for all releases.
|
31
|
+
|
32
|
+
### v0.33.0
|
33
|
+
|
34
|
+
- Add support for `agent-context` gem.
|
35
|
+
- [`receive` now supports blocks and `and_raise`.](https://socketry.github.io/sus/releases/index#receive-now-supports-blocks-and-and_raise.)
|
36
|
+
|
37
|
+
### v0.32.0
|
38
|
+
|
39
|
+
- `Sus::Config` now has a `prepare_warnings!` hook which enables deprecated warnings by default. This is generally considered good behaviour for a test framework.
|
40
|
+
|
28
41
|
## See Also
|
29
42
|
|
30
|
-
- [sus-vscode](https://github.com/socketry/sus-vscode) - Visual Studio Code extension for Sus.
|
43
|
+
- [sus-vscode](https://github.com/socketry/sus-vscode) - Visual Studio Code extension for Sus.
|
31
44
|
|
32
45
|
## Contributing
|
33
46
|
|
data/releases.md
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# Releases
|
2
|
+
|
3
|
+
## v0.33.0
|
4
|
+
|
5
|
+
- Add support for `agent-context` gem.
|
6
|
+
|
7
|
+
### `receive` now supports blocks and `and_raise`.
|
8
|
+
|
9
|
+
The `receive` predicate has been enhanced to support blocks and the `and_raise` method, allowing for more flexible mocking of method calls.
|
10
|
+
|
11
|
+
``` ruby
|
12
|
+
# `receive` with a block:
|
13
|
+
expect(interface).to receive(:implementation) {10}
|
14
|
+
|
15
|
+
# `and_return` with a block:
|
16
|
+
expect(interface).to receive(:implementation).and_return{FakeImplementation.new}
|
17
|
+
|
18
|
+
# `and_raise` for error handling:
|
19
|
+
expect(interface).to receive(:implementation).and_raise(StandardError, "An error occurred")
|
20
|
+
```
|
21
|
+
|
22
|
+
## v0.32.0
|
23
|
+
|
24
|
+
- `Sus::Config` now has a `prepare_warnings!` hook which enables deprecated warnings by default. This is generally considered good behaviour for a test framework.
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.33.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
- Brad Schrag
|
9
|
-
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain:
|
12
11
|
- |
|
@@ -38,15 +37,13 @@ cert_chain:
|
|
38
37
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
39
38
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
40
39
|
-----END CERTIFICATE-----
|
41
|
-
date:
|
40
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
42
41
|
dependencies: []
|
43
|
-
description:
|
44
|
-
email:
|
45
42
|
executables:
|
46
43
|
- sus
|
44
|
+
- sus-host
|
47
45
|
- sus-parallel
|
48
46
|
- sus-tree
|
49
|
-
- sus-host
|
50
47
|
extensions: []
|
51
48
|
extra_rdoc_files: []
|
52
49
|
files:
|
@@ -101,6 +98,7 @@ files:
|
|
101
98
|
- lib/sus/with.rb
|
102
99
|
- license.md
|
103
100
|
- readme.md
|
101
|
+
- releases.md
|
104
102
|
homepage: https://github.com/socketry/sus
|
105
103
|
licenses:
|
106
104
|
- MIT
|
@@ -108,7 +106,6 @@ metadata:
|
|
108
106
|
documentation_uri: https://socketry.github.io/sus/
|
109
107
|
funding_uri: https://github.com/sponsors/ioquatix/
|
110
108
|
source_code_uri: https://github.com/socketry/sus.git
|
111
|
-
post_install_message:
|
112
109
|
rdoc_options: []
|
113
110
|
require_paths:
|
114
111
|
- lib
|
@@ -123,8 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
120
|
- !ruby/object:Gem::Version
|
124
121
|
version: '0'
|
125
122
|
requirements: []
|
126
|
-
rubygems_version: 3.
|
127
|
-
signing_key:
|
123
|
+
rubygems_version: 3.6.7
|
128
124
|
specification_version: 4
|
129
125
|
summary: A fast and scalable test runner.
|
130
126
|
test_files: []
|
metadata.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
�3���}�!s������1�����i����0Z�@��[�m�ӗ�@h0v��T��Iϧ&6�� V��2�=ā�ƺ'=�G���n�bS���h�F(Xb.���GVx �0Z9�K<���,��/�
|