spectre-core 1.12.0 → 1.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/spectre +516 -516
- data/lib/spectre/assertion.rb +10 -10
- data/lib/spectre/bag.rb +21 -21
- data/lib/spectre/curl.rb +397 -397
- data/lib/spectre/diagnostic.rb +39 -39
- data/lib/spectre/environment.rb +30 -30
- data/lib/spectre/helpers.rb +133 -133
- data/lib/spectre/http.rb +373 -364
- data/lib/spectre/logger/console.rb +143 -143
- data/lib/spectre/logger/file.rb +96 -96
- data/lib/spectre/logger.rb +146 -146
- data/lib/spectre/mixin.rb +58 -58
- data/lib/spectre/reporter/console.rb +101 -102
- data/lib/spectre/reporter/junit.rb +100 -100
- data/lib/spectre/resources.rb +49 -49
- data/lib/spectre.rb +447 -440
- metadata +12 -12
data/lib/spectre/assertion.rb
CHANGED
@@ -24,7 +24,7 @@ module Spectre
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def should_not_be_empty
|
27
|
-
raise AssertionFailure.new('The value
|
27
|
+
raise AssertionFailure.new('The value is empty', 'nothing', self) unless self != nil
|
28
28
|
end
|
29
29
|
|
30
30
|
def or other
|
@@ -52,7 +52,7 @@ module Spectre
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def should_not_be_empty
|
55
|
-
raise AssertionFailure.new('
|
55
|
+
raise AssertionFailure.new('The list is empty', 'nil')
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
@@ -66,21 +66,21 @@ module Spectre
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def should_be_empty
|
69
|
-
raise AssertionFailure.new(
|
69
|
+
raise AssertionFailure.new('The object should be empty', nil, self) unless self.empty?
|
70
70
|
end
|
71
71
|
|
72
72
|
def should_not_be_empty
|
73
|
-
raise AssertionFailure.new(
|
73
|
+
raise AssertionFailure.new('The object should not be empty', nil, self) if self.empty?
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
77
|
class ::OpenStruct
|
78
78
|
def should_be_empty
|
79
|
-
raise AssertionFailure.new(
|
79
|
+
raise AssertionFailure.new('The object should be empty', nil, self) unless self.to_h.empty?
|
80
80
|
end
|
81
81
|
|
82
82
|
def should_not_be_empty
|
83
|
-
raise AssertionFailure.new(
|
83
|
+
raise AssertionFailure.new('The object should not be empty', nil, self) if self.to_h.empty?
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
@@ -108,11 +108,11 @@ module Spectre
|
|
108
108
|
end
|
109
109
|
|
110
110
|
def should_be_empty
|
111
|
-
raise AssertionFailure.new('
|
111
|
+
raise AssertionFailure.new('The list is not empty', self) unless self.empty?
|
112
112
|
end
|
113
113
|
|
114
114
|
def should_not_be_empty
|
115
|
-
raise AssertionFailure.new('
|
115
|
+
raise AssertionFailure.new('The list is empty', self) if self.empty?
|
116
116
|
end
|
117
117
|
end
|
118
118
|
|
@@ -134,7 +134,7 @@ module Spectre
|
|
134
134
|
end
|
135
135
|
|
136
136
|
def should_contain(value)
|
137
|
-
raise AssertionFailure.new("
|
137
|
+
raise AssertionFailure.new("The value is nil") if value.nil?
|
138
138
|
|
139
139
|
predicate = proc { |x| self.include? x.to_s }
|
140
140
|
evaluation = SingleEvaluation.new(value)
|
@@ -252,7 +252,7 @@ module Spectre
|
|
252
252
|
end
|
253
253
|
|
254
254
|
def observe desc = nil
|
255
|
-
prefix =
|
255
|
+
prefix = 'observing'
|
256
256
|
prefix += " '#{desc}'" if desc
|
257
257
|
|
258
258
|
begin
|
data/lib/spectre/bag.rb
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
require_relative '../spectre'
|
2
|
-
|
3
|
-
require 'ostruct'
|
4
|
-
|
5
|
-
module Spectre
|
6
|
-
module Bag
|
7
|
-
class << self
|
8
|
-
@@bag
|
9
|
-
|
10
|
-
def bag
|
11
|
-
@@bag
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
Spectre.register do |config|
|
16
|
-
@@bag = OpenStruct.new
|
17
|
-
end
|
18
|
-
|
19
|
-
Spectre.delegate :bag, to: self
|
20
|
-
end
|
21
|
-
end
|
1
|
+
require_relative '../spectre'
|
2
|
+
|
3
|
+
require 'ostruct'
|
4
|
+
|
5
|
+
module Spectre
|
6
|
+
module Bag
|
7
|
+
class << self
|
8
|
+
@@bag
|
9
|
+
|
10
|
+
def bag
|
11
|
+
@@bag
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
Spectre.register do |config|
|
16
|
+
@@bag = OpenStruct.new
|
17
|
+
end
|
18
|
+
|
19
|
+
Spectre.delegate :bag, to: self
|
20
|
+
end
|
21
|
+
end
|