fix 0.10.0 → 0.11.0

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: eae82f600d8eeae1817987ea21a0d4377ffda7da
4
- data.tar.gz: de7db5c010702f6e1623275f0d7e2f294582ca43
3
+ metadata.gz: ccbc93bf4ff31128e7e5d682def07e710e3aea34
4
+ data.tar.gz: c0c46d250151ec9fd0ca317bbe6991dffd47fc03
5
5
  SHA512:
6
- metadata.gz: defc73b6383bcfb2607e5b842ac1490dcffadfd1429f250459721b64c52b6e48f7f0b37c021cbde0d777abced316128f859a57ed962eb5d3695000b35086a583
7
- data.tar.gz: 0bff3242e83234ab17e743f16776ead4ded7b2fd8753f92ebc6f5d3c2e87a4012efb79d2b09419ad2e7ab25ce19c60a396d6bcec26584273228df3aeddd4e896
6
+ metadata.gz: 414fc216517254c25a3610f0e258b3c0897d34e927c6362db443b4ee9338d8f25fde0a5d4a995d730feeb7e5be5ac536dd73e2af1d23f9361774806c07099e21
7
+ data.tar.gz: 9a8cb5d9417bc06897854d00a2e2f924bcc318df459cd8f4c948ae9ae1c3ca642124b91f730f66ba00fc82d135d27f3cc6691a07b0ad77366163094289f77016
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/VERSION.semver CHANGED
@@ -1 +1 @@
1
- 0.10.0
1
+ 0.11.0
@@ -0,0 +1 @@
1
+ f07e9c106cca645ba0df7a5aee870d07c41879410c2768bfb66c64e930d2b671dab08ded95d94db3f6652a93037eac5009a6b7de980b7a054aed8872fca851fe
@@ -0,0 +1 @@
1
+ fa1c66381b7d94687f9562af58230a7d6039adea59a4cad0eb8c04691d620b9f1105e796f311b884f9bdb5d9eda585834be1cafe69d8540141424bfa08df68f3
@@ -0,0 +1 @@
1
+ 3ad80f61582fed9e76a0724fd5fff6138b849865a99a1ac6622ec8c29e67ee4eaae4727b97d53fd534a822c82830c57a77ba35aafaf09bff08e6e0385a8864d6
@@ -0,0 +1 @@
1
+ f5442fc31ceda7b936fbf29cff21b657dcf65c206cb1af1937453580401dfe62598a88701162a7835470961ddf5fa82ef1bfdd83ca9e3581947cf1505e82f3e1
@@ -0,0 +1 @@
1
+ d36afc6b400b8112517de4c7b40d30047b595918128ac9ef75d5cd248adc8cfd6b0b3f06a71b5fe4541d45050ebbee3d8ae3fc372fd9c13d4666de2c01492044
@@ -0,0 +1 @@
1
+ 7505c311763e68d85ea5272485ef103b3406bec7f63195e454586d11b4188b630448a33bd2edc97319ff497f96daa1b67fc8a1848be88cb9ea0c5a089b51bdc4
@@ -0,0 +1 @@
1
+ e75b7472e74e27649ab7605bf8cbd5621765798d07796a3d80da3440f3e9f60f5d99049cfe4811a2576d462716ff20509297b0e6b91a5baedd3414ffa43962d3
@@ -0,0 +1 @@
1
+ 7c99d0d42ad0031835be2c90bf9451f27e7ee23ad75b2ff8b4ac5ded644b273d5f8af6f78c2d0ff836995d91c1f459a18de867dd6df9e4ae966ffe8012a0db20
@@ -0,0 +1 @@
1
+ e9d2df3cb5054a2e9e03e9805980d4b8081b8c25d9fac7596bc7c59f3d337d4a69bce2880b3f204eb29dbf2c2b4e6ae8d3b311bde15da49f4c415fa67bef8ef3
@@ -0,0 +1 @@
1
+ 9e1ba1c6efb495ac5452611baf00dc144208c16fa54bcee1fa605bbb6e894e269de716d9b8a51d51e394f45ae85c4efa5fe9cebec433004c9c40ddb0658b024d
@@ -15,7 +15,7 @@ module Fix
15
15
  #
16
16
  # @return [Array] List of results.
17
17
  def it(&spec)
18
- i = It.new(@front_object, *@challenges)
18
+ i = It.new(@front_object, @challenges, @helpers.dup)
19
19
 
20
20
  result = begin
21
21
  i.instance_eval(&spec)
@@ -22,9 +22,25 @@ module Fix
22
22
  o = On.new(@front_object,
23
23
  results,
24
24
  (@challenges + [Defi.send(method_name, *args)]),
25
+ @helpers.dup,
25
26
  @configuration)
26
27
 
27
28
  o.instance_eval(&block)
28
29
  end
30
+
31
+ # @api public
32
+ #
33
+ # @example Let's define the answer to the Ultimate Question of Life, the
34
+ # Universe, and Everything.
35
+ #
36
+ # let(:answer) { 42 }
37
+ #
38
+ # @param method_name [Symbol] The identifier of a method.
39
+ # @param block [Proc] A spec to compare against the computed value.
40
+ #
41
+ # @return [BasicObject] List of results.
42
+ def let(method_name, &block)
43
+ @helpers.update(method_name => block)
44
+ end
29
45
  end
30
46
  end
data/lib/fix/it.rb CHANGED
@@ -10,9 +10,21 @@ module Fix
10
10
  #
11
11
  # @param subject [BasicObject] The front object.
12
12
  # @param challenges [Array] The list of challenges.
13
- def initialize(subject, *challenges)
13
+ # @param helpers [Hash] The list of helpers.
14
+ def initialize(subject, challenges, helpers)
14
15
  @subject = subject
15
16
  @challenges = challenges
17
+ @helpers = helpers
18
+ end
19
+
20
+ # Override Ruby's method_missing in order to provide let interface.
21
+ #
22
+ # @api private
23
+ # @since 0.11.0
24
+ #
25
+ # @raise [NoMethodError] If doesn't respond to the given method.
26
+ def method_missing(name, *args, &block)
27
+ @helpers.key?(name) ? @helpers.fetch(name).call : super
16
28
  end
17
29
  end
18
30
  end
data/lib/fix/on.rb CHANGED
@@ -17,11 +17,13 @@ module Fix
17
17
  # @param front_object [BasicObject] The front object of the test.
18
18
  # @param results [Array] The list of collected results.
19
19
  # @param challenges [Array] The list of challenges to apply.
20
+ # @param helpers [Hash] The list of helpers.
20
21
  # @param configuration [Hash] Settings.
21
- def initialize(front_object, results, challenges, configuration = {})
22
+ def initialize(front_object, results, challenges, helpers, configuration)
22
23
  @front_object = front_object
23
24
  @results = results
24
25
  @challenges = challenges
26
+ @helpers = helpers
25
27
  @configuration = configuration
26
28
  end
27
29
 
data/lib/fix/report.rb CHANGED
@@ -55,9 +55,7 @@ module Fix
55
55
 
56
56
  next s unless @test.configuration.fetch(:color)
57
57
 
58
- if r.to_sym.equal?(:success)
59
- "\e[32m#{s}\e[0m"
60
- elsif r.to_sym.equal?(:info)
58
+ if r.to_sym.equal?(:info)
61
59
  "\e[33m#{s}\e[0m"
62
60
  elsif r.to_sym.equal?(:failure)
63
61
  "\e[35m#{s}\e[0m"
data/lib/fix/test.rb CHANGED
@@ -18,7 +18,7 @@ module Fix
18
18
 
19
19
  start_time = Time.now
20
20
 
21
- g = On.new(front_object, [], [], @configuration)
21
+ g = On.new(front_object, [], [], {}, @configuration)
22
22
  g.instance_eval(&specs)
23
23
 
24
24
  @results = g.results
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyril Wack
@@ -150,6 +150,16 @@ files:
150
150
  - bin/console
151
151
  - bin/setup
152
152
  - certs/gem-fixrb-public_cert.pem
153
+ - checksum/fix-0.0.1.pre.gem.sha512
154
+ - checksum/fix-0.1.0.gem.sha512
155
+ - checksum/fix-0.1.0.pre.gem.sha512
156
+ - checksum/fix-0.10.0.gem.sha512
157
+ - checksum/fix-0.2.0.gem.sha512
158
+ - checksum/fix-0.3.0.gem.sha512
159
+ - checksum/fix-0.4.0.gem.sha512
160
+ - checksum/fix-0.5.0.gem.sha512
161
+ - checksum/fix-0.6.0.gem.sha512
162
+ - checksum/fix-0.6.1.gem.sha512
153
163
  - checksum/fix-0.7.0.gem.sha512
154
164
  - checksum/fix-0.8.0.gem.sha512
155
165
  - checksum/fix-0.9.0.gem.sha512
metadata.gz.sig CHANGED
Binary file