saharspec 0.0.7 → 0.0.8

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: 0721274eeb44f375081b16acdc0096a4568c33438981d089b542c8ab0962fa79
4
- data.tar.gz: 77f87039cb08a1eaad47a0351494139d1ef5a4b95102fa5357bc5f1c356cd148
3
+ metadata.gz: 402e6f62d9abc17f1dad82a3a5f38ae8f844ca458ad87a4756192976e4cd5496
4
+ data.tar.gz: 1541630eb677716d9ab2e58e1a25427ea86b67c5e001a52a25e9641491006971
5
5
  SHA512:
6
- metadata.gz: 5334a10cad536a2ae6d8c43f0e81638cc65f651e1bd524ad24cc97f6c7f56608b127fe74e3b2efabee9dc9b41d37451ccaf4d9ccc4d3302d1eabb46bb51f7593
7
- data.tar.gz: acd913e42ec0acf3ad8cbe501cd3524cfc078f1a5dcba56282bc5ca5f09799fb84657500331f98567e165f8dca58db835aa344bb15e55f5164e324c412c899be
6
+ metadata.gz: 7923af91fee36b0a8b8c79fdba8d0bf6503598ca62589d8d30a2e8dace0428f9338e892d5e3a0538c4fc857a209b390b6b88eebf8637c41dc68dd6c61d6772d5
7
+ data.tar.gz: 5b844ac0a0098001638d19a2113e0eca4bf7acb225a87a456133e3d1ff564fc96648b95a0e0c37478c07d2532fc005e9c4db35a15b00f6b92018565c70097175
@@ -1,5 +1,9 @@
1
1
  # Saharspec history
2
2
 
3
+ ## 0.0.8 -- 2020-10-10
4
+
5
+ * Better `dont` failure message (just use underlying matchers `failure_message_when_negated`)
6
+
3
7
  ## 0.0.7 -- 2020-04-11
4
8
 
5
9
  * Allow `its_call` to work properly with keyword args on Ruby 2.7
data/README.md CHANGED
@@ -157,7 +157,7 @@ require 'saharspec/matchers/eq_multiline'
157
157
 
158
158
  ### `dont`: matcher negation
159
159
 
160
- Another (exprimental) attempt to get rid of `define_negated_matcher`. `dont` is not 100% grammatically
160
+ Allows to get rid of gazilliions of `define_negated_matcher`. `dont` is not 100% grammatically
161
161
  correct, yet short and readable enought. It just negates attached matcher.
162
162
 
163
163
  ```ruby
@@ -32,7 +32,7 @@ module Saharspec
32
32
  # @param block [Proc] The test itself. Inside it, `is_expected` (or `are_expected`) is related to result
33
33
  # of `map`ping the subject.
34
34
  #
35
- def its_map(attribute, *options, &block) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
35
+ def its_map(attribute, *options, &block) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
36
36
  # rubocop:disable Lint/NestedMethodDefinition
37
37
  # TODO: better desciption for different cases
38
38
  describe("map(&:#{attribute})") do
@@ -4,7 +4,8 @@ module Saharspec
4
4
  module Matchers
5
5
  # @private
6
6
  class Not < RSpec::Matchers::BuiltIn::BaseMatcher
7
- def initialize
7
+ def initialize(*)
8
+ super
8
9
  @delegator = Delegator.new
9
10
  end
10
11
 
@@ -27,11 +28,15 @@ module Saharspec
27
28
  end
28
29
  end
29
30
 
31
+ def failure_message
32
+ @matcher.failure_message_when_negated
33
+ end
34
+
30
35
  def supports_block_expectations?
31
36
  @matcher.supports_block_expectations?
32
37
  end
33
38
 
34
- def method_missing(m, *a, &b) # rubocop:disable Style/MethodMissingSuper
39
+ def method_missing(m, *a, &b) # rubocop:disable Lint/MissingSuper
35
40
  if @matcher
36
41
  @matcher.send(m, *a, &b)
37
42
  else
@@ -41,7 +46,7 @@ module Saharspec
41
46
  self
42
47
  end
43
48
 
44
- def respond_to_missing?(method, include_private = false)
49
+ def respond_to_missing?(method, include_private = false) # rubocop:disable Lint/MissingSuper
45
50
  if @matcher
46
51
  @matcher.respond_to?(method, include_private)
47
52
  else
@@ -3,6 +3,6 @@
3
3
  module Saharspec
4
4
  MAJOR = 0
5
5
  MINOR = 0
6
- PATCH = 7
6
+ PATCH = 8
7
7
  VERSION = [MAJOR, MINOR, PATCH].join('.')
8
8
  end
@@ -27,7 +27,9 @@ Gem::Specification.new do |s|
27
27
 
28
28
  s.add_runtime_dependency 'ruby2_keywords'
29
29
 
30
- s.add_development_dependency 'rubocop', '~> 0.75'
30
+ if RUBY_VERSION >= '2.4' # Newest Rubocop fails on 2.3
31
+ s.add_development_dependency 'rubocop', '~> 0.93'
32
+ end
31
33
  s.add_development_dependency 'rspec', '~> 3.7.0'
32
34
  s.add_development_dependency 'rspec-its'
33
35
  s.add_development_dependency 'simplecov', '~> 0.9'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saharspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Shepelev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-11 00:00:00.000000000 Z
11
+ date: 2020-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby2_keywords
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.75'
33
+ version: '0.93'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.75'
40
+ version: '0.93'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement