sus 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- 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 +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5223e3220b3a2fbc2263efd27ca457b971241eff48bb667f0a2235cc6de5c98c
|
4
|
+
data.tar.gz: 2a6558d6a0cd06527115a569553ded158709b16be0125de5101fcf130ff753b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55acd565c40a26bdbb65abd4f8ae491fadcbb2cdab96f341a76f86ae19187beeac32ab562d497f77fb0e40d8ac2c711aeceb5d984b2f9d1b529f3c74d2579cfb
|
7
|
+
data.tar.gz: d5872899a88f5e02125655773d57ba11930e31f106ef52c2e9b03d584e808cb761ac614bfc83270e94f7cb5c5aceff559dae9456732a39c38d87bf1e851d40ae
|
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,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -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.
|