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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 367e1ad013970cab664e7acb54d3f3e9d71e6637
4
- data.tar.gz: 4f6ac0e10e2c196a70d541865a01bf58288ab86c
3
+ metadata.gz: a73bee7dcc7cafb5edf9ebbcdbc52927c50e3bad
4
+ data.tar.gz: d4867c2dd0f4fb54c1f60677a2189506d84faf71
5
5
  SHA512:
6
- metadata.gz: 3d4925d21b2bbfdfb686a907d39fe80f83930b5f45b8c5decc4e9e6b522f41e6b7edf388219b5ab4e108997ae2b872d1ad2a5adf8e6b030561508df7047782a2
7
- data.tar.gz: 0d27442c87ea51c560c4ed2c848782035a4de546a96f601a8dcc3868bc06f0ece25cd5240b24094e8d30cbf6494a6a2481a4acabf6e5a73ab3c4ddba3cd0e3c0
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
@@ -9,7 +9,6 @@ rvm:
9
9
  - 2.0
10
10
  - 2.1
11
11
  - 2.2
12
- - ruby-head
13
12
  - jruby
14
13
  - jruby-head
15
14
  - rbx-2
data/VERSION.semver CHANGED
@@ -1 +1 @@
1
- 3.0.2
1
+ 3.0.3
@@ -0,0 +1 @@
1
+ 1c1ea426d4a8e24bfe3e2a23d352d7088de747ad29391010bcb62758e6f066ecacbedf272d9c82312a87190cc731d7cc2b41d7f1550e1a6fed4c45c2eda376d6
data/lib/spectus.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'matchi'
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
- Matchi.constants.each do |const|
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.2
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