sus 0.5.0 → 0.6.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
- data/bin/sus +6 -0
- data/bin/sus-parallel +6 -0
- data/lib/sus/describe.rb +2 -5
- data/lib/sus/filter.rb +1 -1
- data/lib/sus/identity.rb +6 -5
- data/lib/sus/it.rb +1 -1
- data/lib/sus/it_behaves_like.rb +2 -5
- data/lib/sus/version.rb +1 -1
- data/lib/sus/with.rb +2 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2eedf780fb01d2963981a6364e0a7ddd9879fd4e99933124c8989f9ccbc10283
|
4
|
+
data.tar.gz: 6a477c4bf989ab5ff4a509711d85dc87bfd8298336dc0e211cd7a9183f6cea67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d84a319444e5179896f4cc5181dec03b385c66c20157aa6394a3b69c7eb2773e45520e6bef890dab861ea769deb53841949ab3ef762d041e5d74505aaee5205
|
7
|
+
data.tar.gz: c33182e1c13956e7fb3d712bb3759bfb4fefd7fff0b5160cf5eb0ac3190cd2a8a519ab32ff82e762ae7ad4000d73b1120c2f7e8967f6b4ee41d82a2401e6b6db
|
data/bin/sus
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
require_relative '../lib/sus'
|
4
4
|
|
5
|
+
if File.exist?("config/test.rb")
|
6
|
+
load("config/test.rb")
|
7
|
+
end
|
8
|
+
|
5
9
|
def prepare(paths, registry)
|
6
10
|
if paths&.any?
|
7
11
|
paths.each do |path|
|
@@ -31,4 +35,6 @@ if assertions.failed.any?
|
|
31
35
|
assertions.failed.each do |failure|
|
32
36
|
failure.output.append(output)
|
33
37
|
end
|
38
|
+
|
39
|
+
exit(1)
|
34
40
|
end
|
data/bin/sus-parallel
CHANGED
@@ -3,6 +3,10 @@
|
|
3
3
|
require_relative '../lib/sus'
|
4
4
|
require_relative '../lib/sus/progress'
|
5
5
|
|
6
|
+
if File.exist?("config/test.rb")
|
7
|
+
load("config/test.rb")
|
8
|
+
end
|
9
|
+
|
6
10
|
require 'etc'
|
7
11
|
|
8
12
|
def prepare(paths, registry)
|
@@ -85,4 +89,6 @@ if assertions.failed.any?
|
|
85
89
|
assertions.failed.each do |failure|
|
86
90
|
failure.output.append(output)
|
87
91
|
end
|
92
|
+
|
93
|
+
exit(1)
|
88
94
|
end
|
data/lib/sus/describe.rb
CHANGED
@@ -7,13 +7,10 @@ module Sus
|
|
7
7
|
|
8
8
|
attr_accessor :subject
|
9
9
|
|
10
|
-
def self.extended(base)
|
11
|
-
base.children = Hash.new
|
12
|
-
end
|
13
|
-
|
14
10
|
def self.build(parent, subject, unique: true, &block)
|
15
11
|
base = Class.new(parent)
|
16
|
-
base.
|
12
|
+
base.singleton_class.prepend(Describe)
|
13
|
+
base.children = Hash.new
|
17
14
|
base.subject = subject
|
18
15
|
base.description = subject.to_s
|
19
16
|
base.identity = Identity.nested(parent.identity, base.description, unique: unique)
|
data/lib/sus/filter.rb
CHANGED
data/lib/sus/identity.rb
CHANGED
@@ -56,7 +56,8 @@ module Sus
|
|
56
56
|
unless @key
|
57
57
|
key = Array.new
|
58
58
|
|
59
|
-
|
59
|
+
# For a specific leaf node, the last part is not unique, i.e. it must be identified explicitly.
|
60
|
+
append_unique_key(key, @unique == true ? false : @unique)
|
60
61
|
|
61
62
|
@key = key.join(':')
|
62
63
|
end
|
@@ -66,18 +67,18 @@ module Sus
|
|
66
67
|
|
67
68
|
protected
|
68
69
|
|
69
|
-
def append_unique_key(key)
|
70
|
+
def append_unique_key(key, unique = @unique)
|
70
71
|
if @parent
|
71
72
|
@parent.append_unique_key(key)
|
72
73
|
else
|
73
74
|
key << @path
|
74
75
|
end
|
75
76
|
|
76
|
-
if
|
77
|
+
if unique == true
|
77
78
|
# No key is needed because this identity is unique.
|
78
79
|
else
|
79
|
-
if
|
80
|
-
key <<
|
80
|
+
if unique
|
81
|
+
key << unique
|
81
82
|
elsif @line
|
82
83
|
key << @line
|
83
84
|
end
|
data/lib/sus/it.rb
CHANGED
@@ -7,7 +7,7 @@ module Sus
|
|
7
7
|
base = Class.new(parent)
|
8
8
|
base.extend(It)
|
9
9
|
base.description = description
|
10
|
-
base.identity = Identity.nested(parent.identity, base.description
|
10
|
+
base.identity = Identity.nested(parent.identity, base.description)
|
11
11
|
|
12
12
|
if block_given?
|
13
13
|
base.define_method(:call, &block)
|
data/lib/sus/it_behaves_like.rb
CHANGED
@@ -7,13 +7,10 @@ module Sus
|
|
7
7
|
|
8
8
|
attr_accessor :shared
|
9
9
|
|
10
|
-
def self.extended(base)
|
11
|
-
base.children = Hash.new
|
12
|
-
end
|
13
|
-
|
14
10
|
def self.build(parent, shared, unique: false)
|
15
11
|
base = Class.new(parent)
|
16
|
-
base.
|
12
|
+
base.singleton_class.prepend(ItBehavesLike)
|
13
|
+
base.children = Hash.new
|
17
14
|
base.description = shared.name
|
18
15
|
base.identity = Identity.nested(parent.identity, base.description, unique: unique)
|
19
16
|
base.class_exec(&shared.block)
|
data/lib/sus/version.rb
CHANGED
data/lib/sus/with.rb
CHANGED
@@ -8,13 +8,10 @@ module Sus
|
|
8
8
|
attr_accessor :subject
|
9
9
|
attr_accessor :variables
|
10
10
|
|
11
|
-
def self.extended(base)
|
12
|
-
base.children = Hash.new
|
13
|
-
end
|
14
|
-
|
15
11
|
def self.build(parent, subject, variables, unique: true, &block)
|
16
12
|
base = Class.new(parent)
|
17
|
-
base.
|
13
|
+
base.singleton_class.prepend(With)
|
14
|
+
base.children = Hash.new
|
18
15
|
base.subject = subject
|
19
16
|
base.description = subject
|
20
17
|
base.identity = Identity.nested(parent.identity, base.description, unique: unique)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-12-
|
11
|
+
date: 2021-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
70
70
|
- !ruby/object:Gem::Version
|
71
71
|
version: '0'
|
72
72
|
requirements: []
|
73
|
-
rubygems_version: 3.
|
73
|
+
rubygems_version: 3.2.32
|
74
74
|
signing_key:
|
75
75
|
specification_version: 4
|
76
76
|
summary: A fast and scalable test runner.
|