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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 440672781a1684a8a6a6e4f1b1cf2efa415c56b1b5b3b67635ac9bad5b75bf41
4
- data.tar.gz: 61653ce52454c226a1d74988d4a2a1c508ad8e41810b6ee5053e3ca8aad01b37
3
+ metadata.gz: 05d88098dffad30c24376c018cf237287c0fce983690310ddf79447d5f6586a7
4
+ data.tar.gz: e329b39eec8ce45dc8accfdebf1915cd3e81480a884c42c2df972d37781dbd1e
5
5
  SHA512:
6
- metadata.gz: f9b00f73615a8e75f3b5e913f63bb6237acf38841da26d5a04231092e396f45242a3463e56642e7e28619a8e44f25ef007339454f6a3c36a8bb782dd72846290
7
- data.tar.gz: 1b74ae4e39835fe2a4232cd15cfd785ceff917709d90fbc15deac7e94bc215a5cdd866f16670c7385db9da70d8c4eb3625fd77314d92b945ee8d4beb32a1292d
6
+ metadata.gz: 2d0298e28fbc6a5f5f316b91fea778adf5cd199be7227e99107dafba800601bcdf71877d21a8ab2bf111fbd50453bbe027768375821c577a44254b17a12adff2
7
+ data.tar.gz: bb23e5558c8640f69772c6d8d3d2bee54c4706ae1f2f75aec693bb0ad82a3cc38f4dec727d063bad09878f21e3d5964e9f9dcd1b444965a7dee630f7c1e8cd23
@@ -1,14 +1,15 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2018-08-26 23:22:23 +0200 using RuboCop version 0.58.2.
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: 12
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'
@@ -7,10 +7,10 @@ script:
7
7
  - bundle exec rubocop
8
8
  - bundle exec rake test
9
9
  rvm:
10
- - 2.2
11
10
  - 2.3.3
12
11
  - 2.4.0
13
12
  - 2.5.0
13
+ - 2.6.2
14
14
  - ruby-head
15
15
  - jruby-head
16
16
  - rbx-3
data/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2014-2018 Cyril Kato
3
+ Copyright (c) 2014-2019 Cyril Kato
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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
- __Fix__ is cryptographically signed.
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](http://sashite.com/img/sashite.png)](http://sashite.com/)
152
+ [![Sashite](https://sashite.com/img/sashite.png)](https://sashite.com/)
@@ -1 +1 @@
1
- 0.17.2
1
+ 0.18.0
@@ -0,0 +1 @@
1
+ 7f74ff80ef63a93a9baa25a7ece0b596cdb1e0f4a974580728d6f2f95ea8d7ceabd875e0f635e8ddd46b964ab48e0247ae7e9705001f6068e312ec0d8feed4c7
@@ -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.2'
20
- spec.add_dependency 'defi', '~> 1.1.4'
21
- spec.add_dependency 'spectus', '~> 3.0.7'
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', '~> 1.16'
24
- spec.add_development_dependency 'rake', '~> 12.3'
25
- spec.add_development_dependency 'rubocop', '~> 0.58'
26
- spec.add_development_dependency 'simplecov', '~> 0.16'
27
- spec.add_development_dependency 'yard', '~> 0.9'
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, options = {}, &specs)
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 options.fetch(:verbose, true)
23
+ print t.report.to_s if verbose
24
24
  exit t.pass?
25
25
  end
26
26
  end
@@ -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
- # @!attribute [r] helpers
26
- #
27
- # @return [Hash] The list of helpers.
28
- attr_reader :helpers
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 => f
38
- f
37
+ rescue ::Spectus::Result::Fail => e
38
+ e
39
39
  end
40
40
  end
41
41
  end
@@ -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.dup)
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
@@ -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, options = {}, &specs)
15
- @configuration = { verbose: true, color: true }
16
- @configuration.update(options)
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: pass_percent,
48
- total_infos: results.count { |r| r.to_sym.equal?(:info) },
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: results.count { |r| r.to_sym.equal?(:error) }
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
- 100
81
- else
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.17.2
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
- - certs/gem-fixrb-public_cert.pem
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.2
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.2
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.4
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.4
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.7
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.7
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: '1.16'
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: '1.16'
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.58'
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.58'
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
- rubyforge_project:
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-----