spectre-core 2.1.1 → 2.1.2
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/lib/spectre/assertion.rb +1 -1
- data/lib/spectre/helpers.rb +1 -1
- data/lib/spectre/version.rb +1 -1
- data/lib/spectre.rb +23 -20
- metadata +35 -21
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2343f54b9e9837df93c730210d5652256643d8514b0456670292b492dc7f770e
|
|
4
|
+
data.tar.gz: 6d934a08ecee932b5346a3d9e98fcd96bc27384f5b9f17cd01b9c08b430c0ff2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 137d6c2c7012d535ba7a93072b67f0cd471ca6b9c5b83225ccb9eb06a433645f078a9928a21c61598059e299c476fe2cbad9f6a4112fd5a0d2d86ed7c2f392e2
|
|
7
|
+
data.tar.gz: ab497f00a4ef0a3ca453f304a6a7e2ac30e0ecdd4910bc27c14c533079638866a2e609e6f618641cdd0ffa337e9575a340a658b1079f2fb18b38cf9cf6adadf4
|
data/lib/spectre/assertion.rb
CHANGED
data/lib/spectre/helpers.rb
CHANGED
data/lib/spectre/version.rb
CHANGED
data/lib/spectre.rb
CHANGED
|
@@ -20,7 +20,7 @@ def get_call_location call_stack
|
|
|
20
20
|
.find { |x| x.label.include? 'Spectre::Engine#load_files' or x.base_label == '<top (required)>' }
|
|
21
21
|
|
|
22
22
|
[
|
|
23
|
-
loc.path.sub(
|
|
23
|
+
loc.path.sub(Spectre.pwd, '.'),
|
|
24
24
|
loc.lineno
|
|
25
25
|
]
|
|
26
26
|
end
|
|
@@ -78,6 +78,13 @@ end
|
|
|
78
78
|
# The main module containing all logic for the framework
|
|
79
79
|
#
|
|
80
80
|
module Spectre
|
|
81
|
+
# Cache Dir.pwd to avoid repeated system calls
|
|
82
|
+
@pwd = Dir.pwd
|
|
83
|
+
|
|
84
|
+
def self.pwd
|
|
85
|
+
@pwd
|
|
86
|
+
end
|
|
87
|
+
|
|
81
88
|
##
|
|
82
89
|
# Exception to throw in order to abort a spec run
|
|
83
90
|
#
|
|
@@ -320,7 +327,7 @@ module Spectre
|
|
|
320
327
|
mixins.each_value do |mixin|
|
|
321
328
|
output = "#{mixin.desc.yellow}\n"
|
|
322
329
|
output += " params.....: #{mixin.params.join ', '}\n" if mixin.params.any?
|
|
323
|
-
output += " location...: #{mixin.file.sub(
|
|
330
|
+
output += " location...: #{mixin.file.sub(Spectre.pwd, '.')}:#{mixin.line}"
|
|
324
331
|
paragraphs << output
|
|
325
332
|
end
|
|
326
333
|
|
|
@@ -802,7 +809,6 @@ module Spectre
|
|
|
802
809
|
DEFAULT_ASYNC_NAME = 'default'
|
|
803
810
|
|
|
804
811
|
@@current = nil
|
|
805
|
-
@@location_cache = {}
|
|
806
812
|
@@skip_count = 0
|
|
807
813
|
|
|
808
814
|
##
|
|
@@ -1071,10 +1077,7 @@ module Spectre
|
|
|
1071
1077
|
def await name = DEFAULT_ASYNC_NAME
|
|
1072
1078
|
return unless @threads.key? name
|
|
1073
1079
|
|
|
1074
|
-
threads = @threads
|
|
1075
|
-
|
|
1076
|
-
@threads.delete(name)
|
|
1077
|
-
|
|
1080
|
+
threads = @threads.delete(name)
|
|
1078
1081
|
threads.map(&:join)
|
|
1079
1082
|
end
|
|
1080
1083
|
|
|
@@ -1259,7 +1262,7 @@ module Spectre
|
|
|
1259
1262
|
file = caller
|
|
1260
1263
|
.first
|
|
1261
1264
|
.gsub(/:in .*/, '')
|
|
1262
|
-
.gsub(
|
|
1265
|
+
.gsub(Spectre.pwd, '.')
|
|
1263
1266
|
|
|
1264
1267
|
context = DefinitionContext.new(desc, file, self)
|
|
1265
1268
|
@children << context
|
|
@@ -1309,7 +1312,7 @@ module Spectre
|
|
|
1309
1312
|
file = caller
|
|
1310
1313
|
.first
|
|
1311
1314
|
.gsub(/:in .*/, '')
|
|
1312
|
-
.gsub(
|
|
1315
|
+
.gsub(Spectre.pwd, '.')
|
|
1313
1316
|
|
|
1314
1317
|
with ||= [nil]
|
|
1315
1318
|
|
|
@@ -1554,9 +1557,11 @@ module Spectre
|
|
|
1554
1557
|
resource_files = Dir.glob File.join(resource_path, '**/*')
|
|
1555
1558
|
|
|
1556
1559
|
resource_files.each do |file|
|
|
1557
|
-
file
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
+
relative_file = file
|
|
1561
|
+
.delete_prefix(resource_path)
|
|
1562
|
+
.delete_prefix('/')
|
|
1563
|
+
|
|
1564
|
+
@resources[relative_file] = File.expand_path(file)
|
|
1560
1565
|
end
|
|
1561
1566
|
end
|
|
1562
1567
|
|
|
@@ -1576,6 +1581,9 @@ module Spectre
|
|
|
1576
1581
|
require module_name
|
|
1577
1582
|
end
|
|
1578
1583
|
end
|
|
1584
|
+
ensure
|
|
1585
|
+
# return to the previous working directory
|
|
1586
|
+
Dir.chdir(Spectre.pwd)
|
|
1579
1587
|
end
|
|
1580
1588
|
|
|
1581
1589
|
# :nodoc:
|
|
@@ -1665,15 +1673,10 @@ module Spectre
|
|
|
1665
1673
|
file = caller
|
|
1666
1674
|
.first
|
|
1667
1675
|
.gsub(/:in .*/, '')
|
|
1668
|
-
.gsub(
|
|
1669
|
-
|
|
1670
|
-
main_context = @contexts.find { |x| x.desc == name }
|
|
1671
|
-
|
|
1672
|
-
if main_context.nil?
|
|
1673
|
-
main_context = DefinitionContext.new(name, file)
|
|
1674
|
-
@contexts << main_context
|
|
1675
|
-
end
|
|
1676
|
+
.gsub(Spectre.pwd, '.')
|
|
1676
1677
|
|
|
1678
|
+
main_context = DefinitionContext.new(name, file)
|
|
1679
|
+
@contexts << main_context
|
|
1677
1680
|
main_context.instance_eval(&)
|
|
1678
1681
|
end
|
|
1679
1682
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spectre-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.1.
|
|
4
|
+
version: 2.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Christian Neubauer
|
|
@@ -13,72 +13,86 @@ dependencies:
|
|
|
13
13
|
name: debug
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
|
15
15
|
requirements:
|
|
16
|
-
- - "
|
|
16
|
+
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: '
|
|
18
|
+
version: '0'
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
|
-
- - "
|
|
23
|
+
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: '
|
|
25
|
+
version: '0'
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: ectoplasm
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
29
29
|
requirements:
|
|
30
|
-
- - "
|
|
30
|
+
- - ">="
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '
|
|
32
|
+
version: '0'
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
|
-
- - "
|
|
37
|
+
- - ">="
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '
|
|
39
|
+
version: '0'
|
|
40
|
+
- !ruby/object:Gem::Dependency
|
|
41
|
+
name: fiddle
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '0'
|
|
47
|
+
type: :runtime
|
|
48
|
+
prerelease: false
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - ">="
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '0'
|
|
40
54
|
- !ruby/object:Gem::Dependency
|
|
41
55
|
name: logger
|
|
42
56
|
requirement: !ruby/object:Gem::Requirement
|
|
43
57
|
requirements:
|
|
44
|
-
- - "
|
|
58
|
+
- - ">="
|
|
45
59
|
- !ruby/object:Gem::Version
|
|
46
|
-
version: '
|
|
60
|
+
version: '0'
|
|
47
61
|
type: :runtime
|
|
48
62
|
prerelease: false
|
|
49
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
50
64
|
requirements:
|
|
51
|
-
- - "
|
|
65
|
+
- - ">="
|
|
52
66
|
- !ruby/object:Gem::Version
|
|
53
|
-
version: '
|
|
67
|
+
version: '0'
|
|
54
68
|
- !ruby/object:Gem::Dependency
|
|
55
69
|
name: ostruct
|
|
56
70
|
requirement: !ruby/object:Gem::Requirement
|
|
57
71
|
requirements:
|
|
58
|
-
- - "
|
|
72
|
+
- - ">="
|
|
59
73
|
- !ruby/object:Gem::Version
|
|
60
|
-
version: '0
|
|
74
|
+
version: '0'
|
|
61
75
|
type: :runtime
|
|
62
76
|
prerelease: false
|
|
63
77
|
version_requirements: !ruby/object:Gem::Requirement
|
|
64
78
|
requirements:
|
|
65
|
-
- - "
|
|
79
|
+
- - ">="
|
|
66
80
|
- !ruby/object:Gem::Version
|
|
67
|
-
version: '0
|
|
81
|
+
version: '0'
|
|
68
82
|
- !ruby/object:Gem::Dependency
|
|
69
83
|
name: stringio
|
|
70
84
|
requirement: !ruby/object:Gem::Requirement
|
|
71
85
|
requirements:
|
|
72
|
-
- - "
|
|
86
|
+
- - ">="
|
|
73
87
|
- !ruby/object:Gem::Version
|
|
74
|
-
version: '
|
|
88
|
+
version: '0'
|
|
75
89
|
type: :runtime
|
|
76
90
|
prerelease: false
|
|
77
91
|
version_requirements: !ruby/object:Gem::Requirement
|
|
78
92
|
requirements:
|
|
79
|
-
- - "
|
|
93
|
+
- - ">="
|
|
80
94
|
- !ruby/object:Gem::Version
|
|
81
|
-
version: '
|
|
95
|
+
version: '0'
|
|
82
96
|
description: A DSL and command line tool to describe and run automated tests
|
|
83
97
|
email:
|
|
84
98
|
- christian.neubauer@ionos.com
|