fix 0.17.2 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +4 -2
- data/.travis.yml +1 -1
- data/LICENSE.md +1 -1
- data/README.md +6 -17
- data/VERSION.semver +1 -1
- data/checksum/fix-0.17.2.gem.sha512 +1 -0
- data/fix.gemspec +9 -12
- data/lib/fix.rb +3 -3
- data/lib/fix/it.rb +9 -9
- data/lib/fix/on.rb +18 -1
- data/lib/fix/test.rb +11 -11
- metadata +29 -17
- data/certs/gem-fixrb-public_cert.pem +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05d88098dffad30c24376c018cf237287c0fce983690310ddf79447d5f6586a7
|
4
|
+
data.tar.gz: e329b39eec8ce45dc8accfdebf1915cd3e81480a884c42c2df972d37781dbd1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d0298e28fbc6a5f5f316b91fea778adf5cd199be7227e99107dafba800601bcdf71877d21a8ab2bf111fbd50453bbe027768375821c577a44254b17a12adff2
|
7
|
+
data.tar.gz: bb23e5558c8640f69772c6d8d3d2bee54c4706ae1f2f75aec693bb0ad82a3cc38f4dec727d063bad09878f21e3d5964e9f9dcd1b444965a7dee630f7c1e8cd23
|
data/.rubocop_todo.yml
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
3
|
+
# on 2019-04-12 02:08:45 +0200 using RuboCop version 0.67.2.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
-
# Offense count:
|
9
|
+
# Offense count: 14
|
10
10
|
Style/MixinUsage:
|
11
11
|
Exclude:
|
12
|
+
- 'test/examples/duck/test_app.rb'
|
12
13
|
- 'test/examples/empty/test_app.rb'
|
13
14
|
- 'test/examples/isolation/test_app_with_isolation_1.rb'
|
14
15
|
- 'test/examples/isolation/test_app_with_isolation_2.rb'
|
@@ -18,6 +19,7 @@ Style/MixinUsage:
|
|
18
19
|
- 'test/examples/isolation/test_app_without_isolation_1.rb'
|
19
20
|
- 'test/examples/isolation/test_app_without_isolation_2.rb'
|
20
21
|
- 'test/examples/isolation/test_app_without_isolation_3.rb'
|
22
|
+
- 'test/examples/let/test_let.rb'
|
21
23
|
- 'test/examples/operation/test_app_1.rb'
|
22
24
|
- 'test/examples/operation/test_app_2.rb'
|
23
25
|
- 'test/test_exit_status.rb'
|
data/.travis.yml
CHANGED
data/LICENSE.md
CHANGED
data/README.md
CHANGED
@@ -15,24 +15,9 @@
|
|
15
15
|
* Bugs/issues: https://github.com/fixrb/fix/issues
|
16
16
|
* Support: https://stackoverflow.com/questions/tagged/fixrb
|
17
17
|
|
18
|
-
## Rubies
|
19
|
-
|
20
|
-
* [MRI](https://www.ruby-lang.org/)
|
21
|
-
* [Rubinius](http://rubini.us/)
|
22
|
-
* [JRuby](http://jruby.org/)
|
23
|
-
|
24
18
|
## Installation
|
25
19
|
|
26
|
-
|
27
|
-
|
28
|
-
To be sure the gem you install hasn't been tampered with, add my public key (if you haven't already) as a trusted certificate:
|
29
|
-
|
30
|
-
$ gem cert --add <(curl -Ls https://raw.github.com/fixrb/fix/master/certs/gem-fixrb-public_cert.pem)
|
31
|
-
$ gem install fix -P HighSecurity
|
32
|
-
|
33
|
-
The `HighSecurity` trust profile will verify all gems. All of __Fix__'s dependencies are signed.
|
34
|
-
|
35
|
-
Or add this line to your application's Gemfile:
|
20
|
+
Add this line to your application's Gemfile:
|
36
21
|
|
37
22
|
```ruby
|
38
23
|
gem 'fix'
|
@@ -42,6 +27,10 @@ And then execute:
|
|
42
27
|
|
43
28
|
$ bundle
|
44
29
|
|
30
|
+
Or install it yourself as:
|
31
|
+
|
32
|
+
$ gem install fix
|
33
|
+
|
45
34
|
## Let's get started!
|
46
35
|
|
47
36
|
[![asciicast](https://asciinema.org/a/29098.png)](https://asciinema.org/a/29098)
|
@@ -160,4 +149,4 @@ See `LICENSE.md` file.
|
|
160
149
|
|
161
150
|
This project is sponsored by:
|
162
151
|
|
163
|
-
[![Sashite](
|
152
|
+
[![Sashite](https://sashite.com/img/sashite.png)](https://sashite.com/)
|
data/VERSION.semver
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.18.0
|
@@ -0,0 +1 @@
|
|
1
|
+
7f74ff80ef63a93a9baa25a7ece0b596cdb1e0f4a974580728d6f2f95ea8d7ceabd875e0f635e8ddd46b964ab48e0247ae7e9705001f6068e312ec0d8feed4c7
|
data/fix.gemspec
CHANGED
@@ -16,17 +16,14 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
17
17
|
spec.require_paths = ['lib']
|
18
18
|
|
19
|
-
spec.add_dependency 'aw', '~> 0.1.
|
20
|
-
spec.add_dependency 'defi', '~> 1.1.
|
21
|
-
spec.add_dependency 'spectus', '~> 3.0.
|
19
|
+
spec.add_dependency 'aw', '~> 0.1.6'
|
20
|
+
spec.add_dependency 'defi', '~> 1.1.5'
|
21
|
+
spec.add_dependency 'spectus', '~> 3.0.8'
|
22
22
|
|
23
|
-
spec.add_development_dependency 'bundler',
|
24
|
-
spec.add_development_dependency 'rake',
|
25
|
-
spec.add_development_dependency 'rubocop',
|
26
|
-
spec.add_development_dependency '
|
27
|
-
spec.add_development_dependency '
|
28
|
-
|
29
|
-
spec.cert_chain = ['certs/gem-fixrb-public_cert.pem']
|
30
|
-
private_key = File.expand_path('~/.ssh/gem-fixrb-private_key.pem')
|
31
|
-
spec.signing_key = private_key if File.exist?(private_key)
|
23
|
+
spec.add_development_dependency 'bundler', '~> 2.0'
|
24
|
+
spec.add_development_dependency 'rake', '~> 12.3'
|
25
|
+
spec.add_development_dependency 'rubocop', '~> 0.67'
|
26
|
+
spec.add_development_dependency 'rubocop-performance', '~> 1.1'
|
27
|
+
spec.add_development_dependency 'simplecov', '~> 0.16'
|
28
|
+
spec.add_development_dependency 'yard', '~> 0.9'
|
32
29
|
end
|
data/lib/fix.rb
CHANGED
@@ -17,10 +17,10 @@ module Fix
|
|
17
17
|
# @param specs [Proc] The set of specs.
|
18
18
|
#
|
19
19
|
# @raise [SystemExit] The result of the test.
|
20
|
-
def self.describe(front_object,
|
21
|
-
t = Test.new(front_object, options, &specs)
|
20
|
+
def self.describe(front_object, verbose: true, **options, &specs)
|
21
|
+
t = Test.new(front_object, verbose: verbose, **options, &specs)
|
22
22
|
|
23
|
-
print t.report.to_s if
|
23
|
+
print t.report.to_s if verbose
|
24
24
|
exit t.pass?
|
25
25
|
end
|
26
26
|
end
|
data/lib/fix/it.rb
CHANGED
@@ -16,16 +16,16 @@ module Fix
|
|
16
16
|
# @param subject [BasicObject] The front object.
|
17
17
|
# @param challenges [Array] The list of challenges.
|
18
18
|
# @param helpers [Hash] The list of helpers.
|
19
|
-
def initialize(subject, challenges, helpers)
|
19
|
+
def initialize(subject, *challenges, **helpers)
|
20
20
|
@subject = subject
|
21
21
|
@challenges = challenges
|
22
|
-
@helpers = helpers
|
23
|
-
end
|
24
22
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
23
|
+
helpers.each do |method_name, method_block|
|
24
|
+
define_singleton_method(method_name) do
|
25
|
+
method_block.call
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
29
|
|
30
30
|
# Verify the expectation.
|
31
31
|
#
|
@@ -34,8 +34,8 @@ module Fix
|
|
34
34
|
# @return [::Spectus::Result::Pass, ::Spectus::Result::Fail] Pass or fail.
|
35
35
|
def verify(&spec)
|
36
36
|
instance_eval(&spec)
|
37
|
-
rescue ::Spectus::Result::Fail =>
|
38
|
-
|
37
|
+
rescue ::Spectus::Result::Fail => e
|
38
|
+
e
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
data/lib/fix/on.rb
CHANGED
@@ -60,7 +60,7 @@ module Fix
|
|
60
60
|
#
|
61
61
|
# @return [Array] List of results.
|
62
62
|
def it(*, &spec)
|
63
|
-
i = It.new(described, challenges, helpers
|
63
|
+
i = It.new(described, *challenges, **helpers)
|
64
64
|
|
65
65
|
result = i.verify(&spec)
|
66
66
|
|
@@ -95,6 +95,23 @@ module Fix
|
|
95
95
|
o.instance_eval(&block)
|
96
96
|
end
|
97
97
|
|
98
|
+
# Add let method to the DSL, to define memoized helper methods.
|
99
|
+
#
|
100
|
+
# @api public
|
101
|
+
#
|
102
|
+
# @example Let's define the answer to the Ultimate Question of Life, the
|
103
|
+
# Universe, and Everything.
|
104
|
+
#
|
105
|
+
# let(:answer) { 42 }
|
106
|
+
#
|
107
|
+
# @param method_name [Symbol] The identifier of a method.
|
108
|
+
# @param block [Proc] A spec to compare against the computed value.
|
109
|
+
#
|
110
|
+
# @return [#object_id] List of results.
|
111
|
+
def let(method_name, &block)
|
112
|
+
helpers.update(method_name => block)
|
113
|
+
end
|
114
|
+
|
98
115
|
# Add context method to the DSL, to build an isolated scope.
|
99
116
|
#
|
100
117
|
# @api public
|
data/lib/fix/test.rb
CHANGED
@@ -11,9 +11,11 @@ module Fix
|
|
11
11
|
# @param front_object [BasicObject] The front object of the test.
|
12
12
|
# @param options [Hash] Some options.
|
13
13
|
# @param specs [Proc] The specs to test against the object.
|
14
|
-
def initialize(front_object,
|
15
|
-
@configuration =
|
16
|
-
|
14
|
+
def initialize(front_object, verbose: true, color: true, **options, &specs)
|
15
|
+
@configuration = options.merge(
|
16
|
+
verbose: verbose,
|
17
|
+
color: color
|
18
|
+
)
|
17
19
|
|
18
20
|
start_time = Time.now
|
19
21
|
|
@@ -44,10 +46,10 @@ module Fix
|
|
44
46
|
# @return [Hash] Some statistics.
|
45
47
|
def statistics
|
46
48
|
{
|
47
|
-
pass_percent:
|
48
|
-
total_infos:
|
49
|
+
pass_percent: pass_percent,
|
50
|
+
total_infos: results.count { |r| r.to_sym.equal?(:info) },
|
49
51
|
total_failures: results.count { |r| r.to_sym.equal?(:failure) },
|
50
|
-
total_errors:
|
52
|
+
total_errors: results.count { |r| r.to_sym.equal?(:error) }
|
51
53
|
}
|
52
54
|
end
|
53
55
|
|
@@ -76,11 +78,9 @@ module Fix
|
|
76
78
|
#
|
77
79
|
# @return [Fixnum] Return the percentage of passing specs.
|
78
80
|
def pass_percent
|
79
|
-
if results.empty?
|
80
|
-
|
81
|
-
|
82
|
-
(results.count(&:result?) / results.length.to_f * 100).round
|
83
|
-
end
|
81
|
+
return 100 if results.empty?
|
82
|
+
|
83
|
+
(results.count(&:result?) / results.length.to_f * 100).round
|
84
84
|
end
|
85
85
|
end
|
86
86
|
end
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyril Kato
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
|
-
cert_chain:
|
11
|
-
|
12
|
-
date: 2018-08-26 00:00:00.000000000 Z
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-04-12 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: aw
|
@@ -17,56 +16,56 @@ dependencies:
|
|
17
16
|
requirements:
|
18
17
|
- - "~>"
|
19
18
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.1.
|
19
|
+
version: 0.1.6
|
21
20
|
type: :runtime
|
22
21
|
prerelease: false
|
23
22
|
version_requirements: !ruby/object:Gem::Requirement
|
24
23
|
requirements:
|
25
24
|
- - "~>"
|
26
25
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.1.
|
26
|
+
version: 0.1.6
|
28
27
|
- !ruby/object:Gem::Dependency
|
29
28
|
name: defi
|
30
29
|
requirement: !ruby/object:Gem::Requirement
|
31
30
|
requirements:
|
32
31
|
- - "~>"
|
33
32
|
- !ruby/object:Gem::Version
|
34
|
-
version: 1.1.
|
33
|
+
version: 1.1.5
|
35
34
|
type: :runtime
|
36
35
|
prerelease: false
|
37
36
|
version_requirements: !ruby/object:Gem::Requirement
|
38
37
|
requirements:
|
39
38
|
- - "~>"
|
40
39
|
- !ruby/object:Gem::Version
|
41
|
-
version: 1.1.
|
40
|
+
version: 1.1.5
|
42
41
|
- !ruby/object:Gem::Dependency
|
43
42
|
name: spectus
|
44
43
|
requirement: !ruby/object:Gem::Requirement
|
45
44
|
requirements:
|
46
45
|
- - "~>"
|
47
46
|
- !ruby/object:Gem::Version
|
48
|
-
version: 3.0.
|
47
|
+
version: 3.0.8
|
49
48
|
type: :runtime
|
50
49
|
prerelease: false
|
51
50
|
version_requirements: !ruby/object:Gem::Requirement
|
52
51
|
requirements:
|
53
52
|
- - "~>"
|
54
53
|
- !ruby/object:Gem::Version
|
55
|
-
version: 3.0.
|
54
|
+
version: 3.0.8
|
56
55
|
- !ruby/object:Gem::Dependency
|
57
56
|
name: bundler
|
58
57
|
requirement: !ruby/object:Gem::Requirement
|
59
58
|
requirements:
|
60
59
|
- - "~>"
|
61
60
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
61
|
+
version: '2.0'
|
63
62
|
type: :development
|
64
63
|
prerelease: false
|
65
64
|
version_requirements: !ruby/object:Gem::Requirement
|
66
65
|
requirements:
|
67
66
|
- - "~>"
|
68
67
|
- !ruby/object:Gem::Version
|
69
|
-
version: '
|
68
|
+
version: '2.0'
|
70
69
|
- !ruby/object:Gem::Dependency
|
71
70
|
name: rake
|
72
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,14 +86,28 @@ dependencies:
|
|
87
86
|
requirements:
|
88
87
|
- - "~>"
|
89
88
|
- !ruby/object:Gem::Version
|
90
|
-
version: '0.
|
89
|
+
version: '0.67'
|
91
90
|
type: :development
|
92
91
|
prerelease: false
|
93
92
|
version_requirements: !ruby/object:Gem::Requirement
|
94
93
|
requirements:
|
95
94
|
- - "~>"
|
96
95
|
- !ruby/object:Gem::Version
|
97
|
-
version: '0.
|
96
|
+
version: '0.67'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop-performance
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.1'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.1'
|
98
111
|
- !ruby/object:Gem::Dependency
|
99
112
|
name: simplecov
|
100
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,7 +156,6 @@ files:
|
|
143
156
|
- VERSION.semver
|
144
157
|
- bin/console
|
145
158
|
- bin/setup
|
146
|
-
- certs/gem-fixrb-public_cert.pem
|
147
159
|
- checksum/fix-0.0.1.pre.gem.sha512
|
148
160
|
- checksum/fix-0.1.0.gem.sha512
|
149
161
|
- checksum/fix-0.1.0.pre.gem.sha512
|
@@ -162,6 +174,7 @@ files:
|
|
162
174
|
- checksum/fix-0.16.0.gem.sha512
|
163
175
|
- checksum/fix-0.17.0.gem.sha512
|
164
176
|
- checksum/fix-0.17.1.gem.sha512
|
177
|
+
- checksum/fix-0.17.2.gem.sha512
|
165
178
|
- checksum/fix-0.2.0.gem.sha512
|
166
179
|
- checksum/fix-0.3.0.gem.sha512
|
167
180
|
- checksum/fix-0.4.0.gem.sha512
|
@@ -198,8 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
198
211
|
- !ruby/object:Gem::Version
|
199
212
|
version: '0'
|
200
213
|
requirements: []
|
201
|
-
|
202
|
-
rubygems_version: 2.7.6
|
214
|
+
rubygems_version: 3.0.3
|
203
215
|
signing_key:
|
204
216
|
specification_version: 4
|
205
217
|
summary: Specing framework.
|
@@ -1,21 +0,0 @@
|
|
1
|
-
-----BEGIN CERTIFICATE-----
|
2
|
-
MIIDdDCCAlygAwIBAgIBATANBgkqhkiG9w0BAQUFADBAMRAwDgYDVQQDDAdjb250
|
3
|
-
YWN0MRUwEwYKCZImiZPyLGQBGRYFY3lyaWwxFTATBgoJkiaJk/IsZAEZFgVlbWFp
|
4
|
-
bDAeFw0xNTA3MzExMjExMDZaFw0xNjA3MzAxMjExMDZaMEAxEDAOBgNVBAMMB2Nv
|
5
|
-
bnRhY3QxFTATBgoJkiaJk/IsZAEZFgVjeXJpbDEVMBMGCgmSJomT8ixkARkWBWVt
|
6
|
-
YWlsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6hUEYoxnn1mtoaiK
|
7
|
-
NiwjzVPqPgQCR9ZeYdWjLJ3UUG2h5Q6awJCnbaGr8LGGcKtveCDbOJRjtdKNuOTH
|
8
|
-
O2FLTkf46nrMGiF+6/j//qh8o0EQHBRKIVMYkxZxZe4Fcqtdf1bWNMZuXeyoDjdt
|
9
|
-
4yiGfizbbTOu0gBf7Yrsv5DsL0a5CU/We7zxMfgGXCVb9PYkD+OWUMcTARYDKfYa
|
10
|
-
nN9ECI7CFm/yXcsof/eIQA5EmJNmQnhx8B+8L6jDqQeSUAUrBZnC9CdloKOoqmEL
|
11
|
-
weqM2g6LM932Ba74rEl4QlFRYDcs8kjr71UcvseHRCUkFr36j26OU8+gKelsTNdO
|
12
|
-
7OZNKQIDAQABo3kwdzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU
|
13
|
-
LSJTN9h29D6bqOhp+vyvhyM0AF4wHgYDVR0RBBcwFYETY29udGFjdEBjeXJpbC5l
|
14
|
-
bWFpbDAeBgNVHRIEFzAVgRNjb250YWN0QGN5cmlsLmVtYWlsMA0GCSqGSIb3DQEB
|
15
|
-
BQUAA4IBAQArqCC1rUyGJlF0DF9ZhUOgggyROvO0/WroSI5zWgzdB8EU7RJpsDIV
|
16
|
-
caGnpji7h0rQIGWQuJ6TL2fTFLfeGRFdIzRZwWC7TeXhcXngJHZxSjDBt2OpfM8A
|
17
|
-
P5eElSQS9iJCetBGGMyt354PfgZkg3URaC+JA6mdEisdtEdo64ElnMsLg9shCqye
|
18
|
-
JSR3BbejbyPVva0/MHKD+dR6RswlcM9KMiYOXQml7a/kH6huOHvVq9gj5xC2ih8W
|
19
|
-
dzJvWzQ1+dJU6WQv75E9ddSkaQrK3nhdgQVu+/wgvGSrsMvOGNz+LXaSDxQqZuwX
|
20
|
-
0KNQFuIukfrdk8URwRnHoAnvx4U93iUw
|
21
|
-
-----END CERTIFICATE-----
|