spectus 3.0.2 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.travis.yml +0 -1
- data/VERSION.semver +1 -1
- data/checksum/spectus-3.0.2.gem.sha512 +1 -0
- data/lib/spectus.rb +2 -21
- data/lib/spectus/matchers.rb +30 -0
- metadata +3 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a73bee7dcc7cafb5edf9ebbcdbc52927c50e3bad
|
4
|
+
data.tar.gz: d4867c2dd0f4fb54c1f60677a2189506d84faf71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66f3454596ee8187624463f92e692ea50e5bde3656ad3795636930c7751a8c5665aabadd7541f0581ab8bbf0053bae429fafa8190f90310cfd2b09a29ab40f2c
|
7
|
+
data.tar.gz: 0aab4038829b1b70b1363c8b5f3be5f77ae4de55d219c7dcecbdf3f971908d88b4214448eb660464e7049880b00791f2301f0ce2694675f846f137ce4821fff7
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/.travis.yml
CHANGED
data/VERSION.semver
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.
|
1
|
+
3.0.3
|
@@ -0,0 +1 @@
|
|
1
|
+
1c1ea426d4a8e24bfe3e2a23d352d7088de747ad29391010bcb62758e6f066ecacbedf272d9c82312a87190cc731d7cc2b41d7f1550e1a6fed4c45c2eda376d6
|
data/lib/spectus.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
require_relative File.join 'spectus', 'matchers'
|
2
2
|
|
3
3
|
# Namespace for the Spectus library.
|
4
4
|
#
|
@@ -8,26 +8,7 @@ require 'matchi'
|
|
8
8
|
# require 'spectus'
|
9
9
|
# it { 42 }.MUST equal 42 # => #<Spectus::Result::Pass...>
|
10
10
|
module Spectus
|
11
|
-
|
12
|
-
name = const
|
13
|
-
.to_s
|
14
|
-
.gsub(/::/, '/')
|
15
|
-
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
|
16
|
-
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
|
17
|
-
.downcase
|
18
|
-
|
19
|
-
# Define a method for the given matcher.
|
20
|
-
#
|
21
|
-
# @example Given the `Matchi::Equal` matcher, its method will be defined as:
|
22
|
-
# def equal(expected)
|
23
|
-
# Matchi::Equal.new(expected)
|
24
|
-
# end
|
25
|
-
#
|
26
|
-
# @return [#matches?] The matcher.
|
27
|
-
define_method name do |*args|
|
28
|
-
Matchi.const_get(const).new(*args)
|
29
|
-
end
|
30
|
-
end
|
11
|
+
include Matchers
|
31
12
|
|
32
13
|
# Expectations are built with this method.
|
33
14
|
#
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'matchi'
|
2
|
+
|
3
|
+
module Spectus
|
4
|
+
# The module includes the list of matcher methods.
|
5
|
+
#
|
6
|
+
# @api public
|
7
|
+
#
|
8
|
+
module Matchers
|
9
|
+
Matchi.constants.each do |const|
|
10
|
+
name = const
|
11
|
+
.to_s
|
12
|
+
.gsub(/::/, '/')
|
13
|
+
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
|
14
|
+
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
|
15
|
+
.downcase
|
16
|
+
|
17
|
+
# Define a method for the given matcher.
|
18
|
+
#
|
19
|
+
# @example Given the `Matchi::Equal` matcher, its method would be:
|
20
|
+
# def equal(expected)
|
21
|
+
# Matchi::Equal.new(expected)
|
22
|
+
# end
|
23
|
+
#
|
24
|
+
# @return [#matches?] The matcher.
|
25
|
+
define_method name do |*args|
|
26
|
+
Matchi.const_get(const).new(*args)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
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: 3.0.
|
4
|
+
version: 3.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyril Wack
|
@@ -189,8 +189,10 @@ files:
|
|
189
189
|
- checksum/spectus-2.9.2.gem.sha512
|
190
190
|
- checksum/spectus-3.0.0.gem.sha512
|
191
191
|
- checksum/spectus-3.0.1.gem.sha512
|
192
|
+
- checksum/spectus-3.0.2.gem.sha512
|
192
193
|
- lib/spectus.rb
|
193
194
|
- lib/spectus/expectation_target.rb
|
195
|
+
- lib/spectus/matchers.rb
|
194
196
|
- lib/spectus/report.rb
|
195
197
|
- lib/spectus/requirement_level/base.rb
|
196
198
|
- lib/spectus/requirement_level/high.rb
|
metadata.gz.sig
CHANGED
Binary file
|