sus 0.27.0 → 0.28.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/sus/be.rb +86 -0
- data/lib/sus/mock.rb +1 -1
- data/lib/sus/version.rb +1 -1
- data/readme.md +3 -3
- data.tar.gz.sig +0 -0
- metadata +3 -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: bbf42a4b39c1c3d893fa9384c9050ab7a5ae94b79484d7e4cd64422fd128f315
|
4
|
+
data.tar.gz: cd6ff7a16f37f3499fe983bf9ed376a10451297b5a4e368b30c04d11c4b8fc45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9445656ad940b6d85db4b3dc2813d1f8b139290877707eb9b8411992a4bd71d0cc2142ab31470b7cbd8a69b1a72bde22e37c6cadf67c83bca9fd8515e9d89ce0
|
7
|
+
data.tar.gz: 4cd4c7e9a3fc7cdba83b6b74ea8d9b57471b859450fd3534d72ae4adc5a9643f595127c779029315b0662f563c143191598eb5764c8ed0ed838be43a1457c888
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/sus/be.rb
CHANGED
@@ -5,10 +5,96 @@
|
|
5
5
|
|
6
6
|
module Sus
|
7
7
|
class Be
|
8
|
+
class And
|
9
|
+
def initialize(predicates)
|
10
|
+
@predicates = predicates
|
11
|
+
end
|
12
|
+
|
13
|
+
def print(output)
|
14
|
+
@predicates.each_with_index do |predicate, index|
|
15
|
+
if index > 0
|
16
|
+
output.write(" and ", :reset)
|
17
|
+
end
|
18
|
+
|
19
|
+
predicate.print(output)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def call(assertions, subject)
|
24
|
+
@predicates.each do |predicate|
|
25
|
+
predicate.call(assertions, subject)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def &(other)
|
30
|
+
And.new(@predicates + [other])
|
31
|
+
end
|
32
|
+
|
33
|
+
def |(other)
|
34
|
+
Or.new(self, other)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
class Or
|
39
|
+
def initialize(predicates)
|
40
|
+
@predicates = predicates
|
41
|
+
end
|
42
|
+
|
43
|
+
def print(output)
|
44
|
+
@predicates.each_with_index do |predicate, index|
|
45
|
+
if index > 0
|
46
|
+
output.write(" or ", :reset)
|
47
|
+
end
|
48
|
+
|
49
|
+
predicate.print(output)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def call(assertions, subject)
|
54
|
+
assertions.nested(self) do |assertions|
|
55
|
+
@predicates.each do |predicate|
|
56
|
+
predicate.call(assertions, subject)
|
57
|
+
end
|
58
|
+
|
59
|
+
if assertions.passed.any?
|
60
|
+
# At least one passed, so we don't care about failures:
|
61
|
+
assertions.failed.clear
|
62
|
+
else
|
63
|
+
# Nothing passed, so we failed:
|
64
|
+
assertions.assert(false, "could not find any matching predicate")
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def &(other)
|
70
|
+
And.new(self, other)
|
71
|
+
end
|
72
|
+
|
73
|
+
def |(other)
|
74
|
+
Or.new(@predicates + [other])
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
8
78
|
def initialize(*arguments)
|
9
79
|
@arguments = arguments
|
10
80
|
end
|
11
81
|
|
82
|
+
def |(other)
|
83
|
+
Or.new([self, other])
|
84
|
+
end
|
85
|
+
|
86
|
+
def or(*others)
|
87
|
+
Or.new([self, *others])
|
88
|
+
end
|
89
|
+
|
90
|
+
def &(other)
|
91
|
+
And.new([self, other])
|
92
|
+
end
|
93
|
+
|
94
|
+
def and(*others)
|
95
|
+
And.new([self, *others])
|
96
|
+
end
|
97
|
+
|
12
98
|
def print(output)
|
13
99
|
operation, *arguments = *@arguments
|
14
100
|
|
data/lib/sus/mock.rb
CHANGED
data/lib/sus/version.rb
CHANGED
data/readme.md
CHANGED
@@ -48,8 +48,8 @@ We welcome contributions to this project.
|
|
48
48
|
|
49
49
|
### Developer Certificate of Origin
|
50
50
|
|
51
|
-
|
51
|
+
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.
|
52
52
|
|
53
|
-
###
|
53
|
+
### Community Guidelines
|
54
54
|
|
55
|
-
This project is
|
55
|
+
This project is best served by a collaborative and respectful environment. Treat each other professionally, respect differing viewpoints, and engage constructively. Harassment, discrimination, or harmful behavior is not tolerated. Communicate clearly, listen actively, and support one another. If any issues arise, please inform the project maintainers.
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.28.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -38,7 +38,7 @@ cert_chain:
|
|
38
38
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
39
39
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
40
40
|
-----END CERTIFICATE-----
|
41
|
-
date: 2024-
|
41
|
+
date: 2024-07-14 00:00:00.000000000 Z
|
42
42
|
dependencies: []
|
43
43
|
description:
|
44
44
|
email:
|
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
requirements: []
|
126
|
-
rubygems_version: 3.5.
|
126
|
+
rubygems_version: 3.5.9
|
127
127
|
signing_key:
|
128
128
|
specification_version: 4
|
129
129
|
summary: A fast and scalable test runner.
|
metadata.gz.sig
CHANGED
Binary file
|