fear-rspec 0.2.0 → 0.3.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
- SHA1:
3
- metadata.gz: 8f759cb1fba803e80557dcee13188953ddab2039
4
- data.tar.gz: fa7f26349dc37c36b0b2a85d89cf60a9c591d218
2
+ SHA256:
3
+ metadata.gz: a161cfe94a0886a0406bb721476bae529c28b39dbcaefec18e3d54c78dae0c03
4
+ data.tar.gz: 77a30a1d5a52ca3178044f32e920a64768a6726d7504c497eb8f59e876e85c00
5
5
  SHA512:
6
- metadata.gz: 48dd6a7a70c6ec250a43876032aaed46bb5f526eac343c2f89383aae53d2438080acd8638b0a6286fb53095137805d337c7eddf33a247e4992e8ca6d10b45c54
7
- data.tar.gz: 8415757e11f14dbe81a4d768c996d38c7a8c28982596c8a53186617cddc7d16113fe61fef97c6c7a00e966556c9bd8b4d7aabcda5245adcbd012071a39aafc5f
6
+ metadata.gz: 191f6fdd149d8810da0f0fa65b86e83a404d200f15c28c1368178483e381e582dbc45a2f62729328479c9aac789efd2c049a051d9ad0ec54beec27384dfb8fb5
7
+ data.tar.gz: 6f531e5109fba8688711dc5c946949b480910704cdd3f619c75238fbdbf67a30f4c5b40000952cd6701900619064725967e0c53e04fba09135dac1fa00734f68
data/.gitignore CHANGED
@@ -1,6 +1,5 @@
1
1
  /.bundle/
2
2
  /.yardoc
3
- /Gemfile.lock
4
3
  /_yardoc/
5
4
  /coverage/
6
5
  /doc/
@@ -1,14 +1,66 @@
1
- inherit_gem:
2
- spbtv_code_style: .strict_rubocop.yml
1
+ inherit_mode:
2
+ merge:
3
+ - Exclude
3
4
 
4
- Style/MethodName:
5
+ AllCops:
6
+ Exclude:
7
+ - 'gemfiles/**/*'
8
+ - 'vendor/bundle/'
9
+
10
+ Layout/MultilineMethodCallIndentation:
11
+ EnforcedStyle: indented
12
+
13
+ Metrics/ClassLength:
14
+ Enabled: false
15
+
16
+ Naming/MethodName:
17
+ Enabled: false
18
+
19
+ Naming/UncommunicativeMethodParamName:
5
20
  Enabled: false
6
21
 
7
22
  Style/Documentation:
8
23
  Enabled: false
9
24
 
10
- RSpec/ExpectActual:
25
+ Style/CaseEquality:
26
+ Enabled: false
27
+
28
+ Style/AccessModifierDeclarations:
29
+ EnforcedStyle: inline
30
+
31
+ Style/GuardClause:
32
+ Enabled: false
33
+
34
+ Style/IfUnlessModifier:
11
35
  Enabled: false
12
36
 
13
- RSpec/DescribeClass:
37
+ Style/TrailingCommaInArguments:
38
+ EnforcedStyleForMultiline: comma
39
+
40
+ Style/TrailingCommaInArrayLiteral:
41
+ EnforcedStyleForMultiline: comma
42
+
43
+ Style/TrailingCommaInHashLiteral:
44
+ EnforcedStyleForMultiline: comma
45
+
46
+ Style/NumericPredicate:
47
+ Enabled: false
48
+
49
+ Style/CommentedKeyword:
50
+ Enabled: false
51
+
52
+ Layout/IndentHeredoc:
53
+ Enabled: false
54
+
55
+ Metrics/BlockLength:
56
+ Exclude:
57
+ - spec/**/*
58
+ - Rakefile
59
+ - fear.gemspec
60
+ - examples/**/*
61
+
62
+ Metrics/LineLength:
63
+ Max: 120
64
+
65
+ Lint/UselessComparison:
14
66
  Enabled: false
@@ -1,6 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.5
3
+ - 2.5.3
4
4
  script:
5
- - rubocop -D
5
+ - bundle exec rubocop -D
6
6
  - bundle exec rspec spec
@@ -0,0 +1,66 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ fear-rspec (0.3.0)
5
+ fear (>= 1.0.0)
6
+ rspec (~> 3.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ ast (2.4.0)
12
+ diff-lcs (1.3)
13
+ fear (1.0.0)
14
+ lru_redux
15
+ treetop
16
+ jaro_winkler (1.5.2)
17
+ lru_redux (1.1.0)
18
+ parallel (1.17.0)
19
+ parser (2.6.2.1)
20
+ ast (~> 2.4.0)
21
+ polyglot (0.3.5)
22
+ powerpack (0.1.2)
23
+ psych (3.1.0)
24
+ rainbow (3.0.0)
25
+ rake (10.5.0)
26
+ rspec (3.8.0)
27
+ rspec-core (~> 3.8.0)
28
+ rspec-expectations (~> 3.8.0)
29
+ rspec-mocks (~> 3.8.0)
30
+ rspec-core (3.8.0)
31
+ rspec-support (~> 3.8.0)
32
+ rspec-expectations (3.8.2)
33
+ diff-lcs (>= 1.2.0, < 2.0)
34
+ rspec-support (~> 3.8.0)
35
+ rspec-mocks (3.8.0)
36
+ diff-lcs (>= 1.2.0, < 2.0)
37
+ rspec-support (~> 3.8.0)
38
+ rspec-support (3.8.0)
39
+ rubocop (0.65.0)
40
+ jaro_winkler (~> 1.5.1)
41
+ parallel (~> 1.10)
42
+ parser (>= 2.5, != 2.5.1.1)
43
+ powerpack (~> 0.1)
44
+ psych (>= 3.1.0)
45
+ rainbow (>= 2.2.2, < 4.0)
46
+ ruby-progressbar (~> 1.7)
47
+ unicode-display_width (~> 1.4.0)
48
+ rubocop-rspec (1.32.0)
49
+ rubocop (>= 0.60.0)
50
+ ruby-progressbar (1.10.0)
51
+ treetop (1.6.10)
52
+ polyglot (~> 0.3)
53
+ unicode-display_width (1.4.1)
54
+
55
+ PLATFORMS
56
+ ruby
57
+
58
+ DEPENDENCIES
59
+ bundler (~> 1.13)
60
+ fear-rspec!
61
+ rake (~> 10.0)
62
+ rubocop (= 0.65.0)
63
+ rubocop-rspec (= 1.32.0)
64
+
65
+ BUNDLED WITH
66
+ 1.17.3
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Gem Version](https://badge.fury.io/rb/fear-rspec.svg)](https://badge.fury.io/rb/fear-rspec)
2
+
1
3
  # Fear::Rspec
2
4
 
3
5
  `fear-rspec` is a set of rspec matchers for [Fear](https://github.com/bolshakov/fear).
@@ -76,6 +78,14 @@ expect(Some(1)).to be_some_of(5) # fails
76
78
  expect(None()).to be_some_of(5) # fails
77
79
  ```
78
80
 
81
+ To match against a `None`, use `be_none` matcher.
82
+
83
+ ```ruby
84
+ expect(5).not_to be_none # passes
85
+ expect(Some(5)).to be_none # fails
86
+ expect(None()).to be_none # passes
87
+ ```
88
+
79
89
  ## Development
80
90
 
81
91
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -1,5 +1,4 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path('lib', __dir__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require 'fear/rspec/version'
5
4
 
@@ -23,9 +22,9 @@ Gem::Specification.new do |spec|
23
22
 
24
23
  spec.add_development_dependency 'bundler', '~> 1.13'
25
24
  spec.add_development_dependency 'rake', '~> 10.0'
26
- spec.add_development_dependency 'spbtv_code_style'
27
- spec.add_development_dependency 'rubocop-rspec'
25
+ spec.add_development_dependency 'rubocop', '0.65.0'
26
+ spec.add_development_dependency 'rubocop-rspec', '1.32.0'
28
27
 
28
+ spec.add_runtime_dependency 'fear', '>= 1.0.0'
29
29
  spec.add_runtime_dependency 'rspec', '~> 3.0'
30
- spec.add_runtime_dependency 'fear', '>= 0.1.0'
31
30
  end
@@ -8,6 +8,7 @@ module Fear
8
8
  require 'fear/rspec/be_left_of'
9
9
  require 'fear/rspec/be_right_of'
10
10
  require 'fear/rspec/be_some_of'
11
+ require 'fear/rspec/be_none'
11
12
  require 'fear/rspec/be_success_of'
12
13
  end
13
14
  end
@@ -0,0 +1,36 @@
1
+ module Fear
2
+ module RSpec
3
+ # Passes if `actual` is Some and matches `expected`.
4
+ #
5
+ # @example
6
+ # expect(5).not_to be_some_of(5)
7
+ # expect(Some(5)).to be_some_of(5)
8
+ # expect(None()).to be_some_of(5)
9
+ #
10
+ ::RSpec::Matchers.define :be_none do
11
+ match do |actual|
12
+ actual == Fear::None
13
+ end
14
+
15
+ failure_message_when_negated do |actual|
16
+ format(
17
+ "\nexpected: not None\n got: %<actual>s\n",
18
+ actual: ::RSpec::Support::ObjectFormatter.format(actual),
19
+ )
20
+ end
21
+
22
+ failure_message do |actual|
23
+ format(
24
+ "\nexpected: None\n got: %<actual>s\n",
25
+ actual: ::RSpec::Support::ObjectFormatter.format(actual),
26
+ )
27
+ end
28
+
29
+ description do
30
+ 'be None'
31
+ end
32
+
33
+ diffable
34
+ end
35
+ end
36
+ end
@@ -1,5 +1,5 @@
1
1
  module Fear
2
2
  module Rspec
3
- VERSION = '0.2.0'.freeze
3
+ VERSION = '0.3.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fear-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tema Bolshakov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-25 00:00:00.000000000 Z
11
+ date: 2019-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -39,61 +39,61 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: spbtv_code_style
42
+ name: rubocop
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 0.65.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: 0.65.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rubocop-rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 1.32.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: 1.32.0
69
69
  - !ruby/object:Gem::Dependency
70
- name: rspec
70
+ name: fear
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '3.0'
75
+ version: 1.0.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '3.0'
82
+ version: 1.0.0
83
83
  - !ruby/object:Gem::Dependency
84
- name: fear
84
+ name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.1.0
89
+ version: '3.0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.1.0
96
+ version: '3.0'
97
97
  description: RSpec matchers for Fear gem
98
98
  email:
99
99
  - abolshakov@spbtv.com
@@ -106,6 +106,7 @@ files:
106
106
  - ".rubocop.yml"
107
107
  - ".travis.yml"
108
108
  - Gemfile
109
+ - Gemfile.lock
109
110
  - LICENSE.txt
110
111
  - README.md
111
112
  - Rakefile
@@ -115,6 +116,7 @@ files:
115
116
  - lib/fear/rspec.rb
116
117
  - lib/fear/rspec/be_failure_of.rb
117
118
  - lib/fear/rspec/be_left_of.rb
119
+ - lib/fear/rspec/be_none.rb
118
120
  - lib/fear/rspec/be_right_of.rb
119
121
  - lib/fear/rspec/be_some_of.rb
120
122
  - lib/fear/rspec/be_success_of.rb
@@ -138,8 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
140
  - !ruby/object:Gem::Version
139
141
  version: '0'
140
142
  requirements: []
141
- rubyforge_project:
142
- rubygems_version: 2.5.1
143
+ rubygems_version: 3.0.3
143
144
  signing_key:
144
145
  specification_version: 4
145
146
  summary: RSpec matchers for Fear gem