spectus 2.1.3 → 2.2.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
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +1 -1
- data/README.md +4 -4
- data/VERSION.semver +1 -1
- data/checksum/spectus-2.1.3.gem.sha512 +1 -0
- data/checksum/spectus-2.2.0.gem.sha512 +1 -0
- data/lib/spectus/level/base.rb +2 -2
- data/lib/spectus/result/base.rb +2 -9
- data/lib/spectus/result/pass.rb +0 -2
- metadata +5 -3
- metadata.gz.sig +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e08a0c9d455c7e57dc73d412e7f1a1c6a470b954
|
4
|
+
data.tar.gz: 19554aba37f38c6227b199498bb5b99df33a9896
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c514e5429e220d6f8dd0954d7a6779951efb876d6cf0565ee4042f77618f2ef5127b6f2232de254f1133099393c53e4879611f41903d7ba6059ff601474dfcb
|
7
|
+
data.tar.gz: 013b5b2aeb1507c74ba3fb4ec942cb56fde0a3ede1c3acc4d16027292991fc99dedf92ba7290f701737488e6728f15a795936415ea1677661edef32343a5fbe5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
��
|
1
|
+
qrS��J�{��4��)�����:��|�v��\���q����w�^XaìS��%�!�\��8hp(�r�G��u����w2B�Su��/�?�Ҝ���Z9�$|��U'�+��D�����Ǫa#P��g��,h���N�Ҹ��U�ڒ�݀O� N�8�H%mG�*�p��l�R@fY�/
|
data/README.md
CHANGED
@@ -58,7 +58,7 @@ Given the `"ルビー"` object, when it receives `valid_encoding?` method, then
|
|
58
58
|
|
59
59
|
```ruby
|
60
60
|
Spectus.this { 'ルビー'.valid_encoding? }.MUST :BeTrue
|
61
|
-
# => #<Spectus::Result::Pass:
|
61
|
+
# => #<Spectus::Result::Pass:0x007fbbc12b9fd8 @subject=#<Proc:0x007fbbc12ba410@(irb):1>, @challenge=:call, @context=[], @actual=true, @expected=:BeTrue, @got=true, @error=nil, @level=:High, @negate=false, @valid=true>
|
62
62
|
```
|
63
63
|
|
64
64
|
The result of the test shows that the spec passed.
|
@@ -69,7 +69,7 @@ Given the `"foo"` object, when it receives `length` method, then it **MUST NOT**
|
|
69
69
|
|
70
70
|
```ruby
|
71
71
|
Spectus.this { 'foo'.length }.MUST_NOT RaiseException: NoMethodError
|
72
|
-
# => #<Spectus::Result::Pass:
|
72
|
+
# => #<Spectus::Result::Pass:0x007fbbc12a8e90 @subject=#<Proc:0x007fbbc12a95e8@(irb):2>, @challenge=:call, @context=[], @actual=3, @expected={:RaiseException=>NoMethodError}, @got=true, @error=nil, @level=:High, @negate=true, @valid=true>
|
73
73
|
```
|
74
74
|
|
75
75
|
The result of the test shows that the spec passed.
|
@@ -80,7 +80,7 @@ Given the `BasicObject` object, when it receives `superclass` method, then it **
|
|
80
80
|
|
81
81
|
```ruby
|
82
82
|
Spectus.this { BasicObject.superclass }.SHOULD Equal: NilClass
|
83
|
-
# => #<Spectus::Result::Pass:
|
83
|
+
# => #<Spectus::Result::Pass:0x007fbbc1291ec0 @subject=#<Proc:0x007fbbc12923e8@(irb):3>, @challenge=:call, @context=[], @actual=nil, @expected={:Equal=>NilClass}, @got=false, @error=nil, @level=:Medium, @negate=false, @valid=false>
|
84
84
|
```
|
85
85
|
|
86
86
|
Instead of the expected `NilClass` class, its sole instance (which is `nil`) was returned.
|
@@ -103,7 +103,7 @@ Given the `"foo"` object, when it receives `blank?` method, then it **MAY** be `
|
|
103
103
|
|
104
104
|
```ruby
|
105
105
|
Spectus.this { 'foo'.blank? }.MAY :BeFalse
|
106
|
-
# => #<Spectus::Result::Pass:
|
106
|
+
# => #<Spectus::Result::Pass:0x007fbbc1b7c238 @subject=#<Proc:0x007fbbc1b7c698@(irb):5>, @challenge=:call, @context=[], @actual=nil, @expected=:BeFalse, @got=nil, @error=#<NoMethodError: undefined method `blank?' for "foo":String>, @level=:Low, @negate=false, @valid=false>
|
107
107
|
```
|
108
108
|
|
109
109
|
The optional `blank?` method is not implemented (unlike in [Ruby on Rails](http://api.rubyonrails.org/classes/Object.html#method-i-blank-3F), for instance), so the result of the test shows that the spec passed.
|
data/VERSION.semver
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.2.0
|
@@ -0,0 +1 @@
|
|
1
|
+
2837aff76c22e3d8627b0c4139ba633c0032ba4b993f9cac9b0bc33897acd334d5ba9f78a5f71525dd287a4ab9eff545eff42a92e73c368630edd3690b15f47c
|
@@ -0,0 +1 @@
|
|
1
|
+
2c4f497d16f5d0a4898abe0fb7ab620e76fe4e21d14f3ecfca03b1c43d388cb92e6a9a3b8c228bc922147440272dfbcfd2c2dbfc1e1466638246511143e3c6f1
|
data/lib/spectus/level/base.rb
CHANGED
@@ -29,14 +29,14 @@ module Spectus
|
|
29
29
|
#
|
30
30
|
# @return [Result::Pass] pass the spec.
|
31
31
|
def pass!(state)
|
32
|
-
Result::Pass.new(
|
32
|
+
Result::Pass.new(*result_signature(state))
|
33
33
|
end
|
34
34
|
|
35
35
|
# @param state [Sandbox] The sandbox that tested the code.
|
36
36
|
#
|
37
37
|
# @raise [Result::Fail] fail the spec.
|
38
38
|
def fail!(state)
|
39
|
-
fail
|
39
|
+
fail Result::Fail.new(*result_signature(state)), 'failing spec'
|
40
40
|
end
|
41
41
|
|
42
42
|
# @param state [Sandbox] The sandbox that tested the code.
|
data/lib/spectus/result/base.rb
CHANGED
@@ -7,7 +7,6 @@ module Spectus
|
|
7
7
|
module Base
|
8
8
|
# Initialize the result class.
|
9
9
|
#
|
10
|
-
# @param message [String] It is describing the actual/error value.
|
11
10
|
# @param subject [#object_id] The untrusted object to be tested.
|
12
11
|
# @param challenge [Symbol] The method to call on the subject.
|
13
12
|
# @param context [Array] Parameters of the challenge.
|
@@ -21,14 +20,8 @@ module Spectus
|
|
21
20
|
# @param level [:High, :Medium, :Low] The level of the expectation.
|
22
21
|
# @param negate [Boolean] Evaluate to a negative assertion.
|
23
22
|
# @param valid [Boolean] Report if the test was true or false.
|
24
|
-
def initialize(
|
25
|
-
|
26
|
-
|
27
|
-
if respond_to?(:exception)
|
28
|
-
super(message)
|
29
|
-
else
|
30
|
-
@message = message
|
31
|
-
end
|
23
|
+
def initialize(subject, challenge, context, actual, expected, got, error,
|
24
|
+
level, negate, valid)
|
32
25
|
|
33
26
|
@subject = subject
|
34
27
|
@challenge = challenge
|
data/lib/spectus/result/pass.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spectus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyril Wack
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
dzJvWzQ1+dJU6WQv75E9ddSkaQrK3nhdgQVu+/wgvGSrsMvOGNz+LXaSDxQqZuwX
|
31
31
|
0KNQFuIukfrdk8URwRnHoAnvx4U93iUw
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2015-
|
33
|
+
date: 2015-08-22 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: matchi
|
@@ -144,6 +144,8 @@ files:
|
|
144
144
|
- checksum/spectus-2.1.0.gem.sha512
|
145
145
|
- checksum/spectus-2.1.1.gem.sha512
|
146
146
|
- checksum/spectus-2.1.2.gem.sha512
|
147
|
+
- checksum/spectus-2.1.3.gem.sha512
|
148
|
+
- checksum/spectus-2.2.0.gem.sha512
|
147
149
|
- lib/spectus.rb
|
148
150
|
- lib/spectus/challenge.rb
|
149
151
|
- lib/spectus/expectation_target.rb
|
@@ -177,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
179
|
version: '0'
|
178
180
|
requirements: []
|
179
181
|
rubyforge_project:
|
180
|
-
rubygems_version: 2.4.5
|
182
|
+
rubygems_version: 2.4.5.1
|
181
183
|
signing_key:
|
182
184
|
specification_version: 4
|
183
185
|
summary: Expectation library with RFC 2119 keywords.
|
metadata.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
�+�:A��鏡(�K9ҝ�d��䉨�Q��������%��O�o�UoZ$��S��ߋٹܪA�)�W1��rɴ�uh���+C���>�N�ޘ�_�fS�bf��HAZ��B�J��=�؍�m�a���N��㤯W��
|
2
|
+
�({]���V��'�<Lt���Օ�0� ��he���|�q ��{��_��Hxr����o�R�=�S`_��� �N�
|