remockable 0.3.6 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef80f7b524d17e73de94dafc8d36b8120edae8b6aab8170e57039615e1557c97
4
- data.tar.gz: 80c872679d99fd3069ad06aa10cdcdd13c038032587b7fae013b59fe772e3475
3
+ metadata.gz: 4ffc2a8134d4c752ce38d77cec8e266d50ea9f0f14d4d68c039d54983a25786e
4
+ data.tar.gz: 695c352b12e802ba5f175dea7bed983ef7051323d11157e52b58924172e8ae4f
5
5
  SHA512:
6
- metadata.gz: 7d5cf787a0c433229049974f76aad5298ce52adf1a01714a2a88b0edc6f1c6b8088af6c9b26d377dfadd6397941f863848ff06cadc4dbaa2f3740f11c0a59c9b
7
- data.tar.gz: 862979cfc511476b7b0ca74aec5760cb5dbd01d697c7f17c525ea26176bc1b25bfa15c1ca971c2bfaadfc6eadd3c7717f13a9d3864a189de42b66506ae230ef8
6
+ metadata.gz: 61b0cb9dde668204f1dd5a150e24f299030f3049fb4218bae92c494ea8fb5843740cca45ee65dec6833841c5303b40ba44dfef632da7c60d060c1c4021ae2422
7
+ data.tar.gz: bae3c12a4724a77e40c99e3fbc9cc5cb4ad46132d2a7a2071349f8e44c188904679ef8594988cfa7271d27c371402e5dc9856ec1d4a479d7408f6d421bbc43a4
@@ -0,0 +1,64 @@
1
+ name: Build
2
+ on:
3
+ - push
4
+ - pull_request
5
+
6
+ jobs:
7
+ build:
8
+ name: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }}
9
+ if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
10
+ strategy:
11
+ fail-fast: false
12
+ matrix:
13
+ ruby:
14
+ - "2.5"
15
+ - "2.6"
16
+ - "2.7"
17
+ - "3.0"
18
+ - "3.1"
19
+ rails:
20
+ - "4.2"
21
+ - "5.0"
22
+ - "5.1"
23
+ - "5.2"
24
+ - "6.0"
25
+ - "6.1"
26
+ exclude:
27
+ - ruby: "2.7"
28
+ rails: "4.2"
29
+
30
+ - ruby: "3.0"
31
+ rails: "4.2"
32
+ - ruby: "3.0"
33
+ rails: "5.0"
34
+ - ruby: "3.0"
35
+ rails: "5.1"
36
+ - ruby: "3.0"
37
+ rails: "5.2"
38
+
39
+ - ruby: "3.1"
40
+ rails: "4.2"
41
+ - ruby: "3.1"
42
+ rails: "5.0"
43
+ - ruby: "3.1"
44
+ rails: "5.1"
45
+ - ruby: "3.1"
46
+ rails: "5.2"
47
+ - ruby: "3.1"
48
+ rails: "6.0"
49
+
50
+ runs-on: "ubuntu-latest"
51
+
52
+ env:
53
+ BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.gemfile
54
+ RUBYOPT: "--disable-error_highlight"
55
+
56
+ steps:
57
+ - uses: actions/checkout@v2
58
+ - uses: ruby/setup-ruby@v1
59
+ with:
60
+ ruby-version: ${{ matrix.ruby }}
61
+ - name: Setup project
62
+ run: bundle install
63
+ - name: Run tests
64
+ run: bundle exec rspec
data/Appraisals CHANGED
@@ -2,22 +2,36 @@ appraise 'rails-4.2' do
2
2
  gem 'activemodel', '~> 4.2'
3
3
  gem 'activerecord', '~> 4.2'
4
4
  gem 'activesupport', '~> 4.2'
5
+ gem 'sqlite3', '~> 1.3.6'
5
6
  end
6
7
 
7
8
  appraise 'rails-5.0' do
8
- gem 'activemodel', '~> 5.0'
9
- gem 'activerecord', '~> 5.0'
10
- gem 'activesupport', '~> 5.0'
9
+ gem 'activemodel', '~> 5.0.0'
10
+ gem 'activerecord', '~> 5.0.0'
11
+ gem 'activesupport', '~> 5.0.0'
12
+ gem 'sqlite3', '~> 1.3.6'
11
13
  end
12
14
 
13
15
  appraise 'rails-5.1' do
14
- gem 'activemodel', '~> 5.1'
15
- gem 'activerecord', '~> 5.1'
16
- gem 'activesupport', '~> 5.1'
16
+ gem 'activemodel', '~> 5.1.0'
17
+ gem 'activerecord', '~> 5.1.0'
18
+ gem 'activesupport', '~> 5.1.0'
17
19
  end
18
20
 
19
21
  appraise 'rails-5.2' do
20
- gem 'activemodel', '~> 5.2'
21
- gem 'activerecord', '~> 5.2'
22
- gem 'activesupport', '~> 5.2'
22
+ gem 'activemodel', '~> 5.2.0'
23
+ gem 'activerecord', '~> 5.2.0'
24
+ gem 'activesupport', '~> 5.2.0'
25
+ end
26
+
27
+ appraise 'rails-6.0' do
28
+ gem 'activemodel', '~> 6.0.0'
29
+ gem 'activerecord', '~> 6.0.0'
30
+ gem 'activesupport', '~> 6.0.0'
31
+ end
32
+
33
+ appraise 'rails-6.1' do
34
+ gem 'activemodel', '~> 6.1.0'
35
+ gem 'activerecord', '~> 6.1.0'
36
+ gem 'activesupport', '~> 6.1.0'
23
37
  end
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.9 (2022-05-04)
4
+
5
+ * Allow `:required`/`:optional` aliases with `belongs_to`
6
+ ([Tyler Hunt][tylerhunt])
7
+
8
+ ## 0.3.8 (2021-07-23)
9
+
10
+ * Add `:where` option to `have_index` ([Tyler Hunt][tylerhunt])
11
+
12
+ ## 0.3.7 (2021-01-12)
13
+
14
+ * Support Rails 6.0, 6.1 ([AGuyNamedRyan][])
15
+
3
16
  ## 0.3.6 (2018-05-07)
4
17
 
5
18
  * Support Rails 5.2 ([Tyler Hunt][tylerhunt])
@@ -115,7 +128,8 @@
115
128
 
116
129
  * Initial release ([Tyler Hunt][tylerhunt])
117
130
 
131
+ [aguynamedryan]: https://github.com/aguynamedryan
118
132
  [jswanner]: https://github.com/jswanner
133
+ [nbibler]: https://github.com/nbibler
119
134
  [olivierlacan]: https://github.com/olivierlacan
120
135
  [tylerhunt]: https://github.com/tylerhunt
121
- [nbibler]: https://github.com/nbibler
data/README.markdown CHANGED
@@ -1,11 +1,13 @@
1
1
  # Remockable
2
2
 
3
- [![Build Status][travis-image]][travis] [![Dependency Status][gemnasium-image]][gemnasium] [![Gem Version][rubygems-image]][rubygems]
4
-
5
- [travis]: https://travis-ci.org/tylerhunt/remockable
6
- [travis-image]: https://travis-ci.org/tylerhunt/remockable.svg?branch=master
7
- [gemnasium]: https://gemnasium.com/github.com/tylerhunt/remockable
8
- [gemnasium-image]: https://gemnasium.com/badges/github.com/tylerhunt/remockable.svg
3
+ [![Build][build-image]][build]
4
+ [![Maintainability][codeclimate-image]][codeclimate]
5
+ [![Gem Version][rubygems-image]][rubygems]
6
+
7
+ [build]: https://github.com/tylerhunt/remockable/actions/workflows/build.yml?query=branch%3Amaster
8
+ [build-image]: https://github.com/tylerhunt/remockable/actions/workflows/build.yml/badge.svg
9
+ [codeclimate]: https://codeclimate.com/github/tylerhunt/remockable/maintainability
10
+ [codeclimate-image]: https://api.codeclimate.com/v1/badges/c95736ab7cca49228f5c/maintainability
9
11
  [rubygems]: https://badge.fury.io/rb/remockable
10
12
  [rubygems-image]: https://badge.fury.io/rb/remockable.svg
11
13
 
@@ -92,13 +94,13 @@ it { should have_many :subscriptions, through: :customers }
92
94
 
93
95
  ## Contributing
94
96
 
95
- 1. Fork it.
96
- 2. Create your feature branch (`git checkout -b my-new-feature`).
97
- 3. Commit your changes (`git commit -am 'Added some feature'`).
98
- 4. Push to the branch (`git push origin my-new-feature`).
99
- 5. Create a new Pull Request.
97
+ 1. Fork it.
98
+ 2. Create your feature branch (`git checkout -b my-new-feature`).
99
+ 3. Commit your changes (`git commit -am 'Added some feature'`).
100
+ 4. Push to the branch (`git push origin my-new-feature`).
101
+ 5. Create a new Pull Request.
100
102
 
101
103
 
102
104
  ## Copyright
103
105
 
104
- Copyright © 2010-2013 Tyler Hunt. See LICENSE for details.
106
+ Copyright © 2010–2022 Tyler Hunt. See LICENSE for details.
@@ -5,5 +5,6 @@ source "https://rubygems.org/"
5
5
  gem "activemodel", "~> 4.2"
6
6
  gem "activerecord", "~> 4.2"
7
7
  gem "activesupport", "~> 4.2"
8
+ gem "sqlite3", "~> 1.3.6"
8
9
 
9
10
  gemspec :path => "../"
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- remockable (0.3.5)
5
- activemodel (>= 4.0, < 5.3)
6
- activerecord (>= 4.0, < 5.3)
7
- activesupport (>= 4.0, < 5.3)
4
+ remockable (0.3.9)
5
+ activemodel (>= 4.0, < 6.2)
6
+ activerecord (>= 4.0, < 6.2)
7
+ activesupport (>= 4.0, < 6.2)
8
8
  rspec-core (~> 3.0)
9
9
  rspec-expectations (~> 3.0)
10
10
  rspec-mocks (~> 3.0)
@@ -12,41 +12,43 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activemodel (4.2.8)
16
- activesupport (= 4.2.8)
15
+ activemodel (4.2.11.3)
16
+ activesupport (= 4.2.11.3)
17
17
  builder (~> 3.1)
18
- activerecord (4.2.8)
19
- activemodel (= 4.2.8)
20
- activesupport (= 4.2.8)
18
+ activerecord (4.2.11.3)
19
+ activemodel (= 4.2.11.3)
20
+ activesupport (= 4.2.11.3)
21
21
  arel (~> 6.0)
22
- activesupport (4.2.8)
22
+ activesupport (4.2.11.3)
23
23
  i18n (~> 0.7)
24
24
  minitest (~> 5.1)
25
25
  thread_safe (~> 0.3, >= 0.3.4)
26
26
  tzinfo (~> 1.1)
27
- appraisal (2.2.0)
27
+ appraisal (2.3.0)
28
28
  bundler
29
29
  rake
30
30
  thor (>= 0.14.0)
31
31
  arel (6.0.4)
32
- builder (3.2.3)
33
- diff-lcs (1.3)
34
- i18n (0.8.1)
35
- minitest (5.10.1)
36
- rake (12.0.0)
37
- rspec-core (3.6.0)
38
- rspec-support (~> 3.6.0)
39
- rspec-expectations (3.6.0)
32
+ builder (3.2.4)
33
+ concurrent-ruby (1.1.7)
34
+ diff-lcs (1.5.0)
35
+ i18n (0.9.5)
36
+ concurrent-ruby (~> 1.0)
37
+ minitest (5.14.3)
38
+ rake (13.0.3)
39
+ rspec-core (3.11.0)
40
+ rspec-support (~> 3.11.0)
41
+ rspec-expectations (3.11.0)
40
42
  diff-lcs (>= 1.2.0, < 2.0)
41
- rspec-support (~> 3.6.0)
42
- rspec-mocks (3.6.0)
43
+ rspec-support (~> 3.11.0)
44
+ rspec-mocks (3.11.0)
43
45
  diff-lcs (>= 1.2.0, < 2.0)
44
- rspec-support (~> 3.6.0)
45
- rspec-support (3.6.0)
46
+ rspec-support (~> 3.11.0)
47
+ rspec-support (3.11.0)
46
48
  sqlite3 (1.3.13)
47
- thor (0.19.4)
49
+ thor (1.0.1)
48
50
  thread_safe (0.3.6)
49
- tzinfo (1.2.3)
51
+ tzinfo (1.2.9)
50
52
  thread_safe (~> 0.1)
51
53
 
52
54
  PLATFORMS
@@ -59,7 +61,7 @@ DEPENDENCIES
59
61
  appraisal (~> 2.1)
60
62
  rake
61
63
  remockable!
62
- sqlite3 (~> 1.3.4)
64
+ sqlite3 (~> 1.3.6)
63
65
 
64
66
  BUNDLED WITH
65
- 1.16.1
67
+ 2.3.6
@@ -2,8 +2,9 @@
2
2
 
3
3
  source "https://rubygems.org/"
4
4
 
5
- gem "activemodel", "~> 5.0"
6
- gem "activerecord", "~> 5.0"
7
- gem "activesupport", "~> 5.0"
5
+ gem "activemodel", "~> 5.0.0"
6
+ gem "activerecord", "~> 5.0.0"
7
+ gem "activesupport", "~> 5.0.0"
8
+ gem "sqlite3", "~> 1.3.6"
8
9
 
9
10
  gemspec :path => "../"
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- remockable (0.3.5)
5
- activemodel (>= 4.0, < 5.3)
6
- activerecord (>= 4.0, < 5.3)
7
- activesupport (>= 4.0, < 5.3)
4
+ remockable (0.3.9)
5
+ activemodel (>= 4.0, < 6.2)
6
+ activerecord (>= 4.0, < 6.2)
7
+ activesupport (>= 4.0, < 6.2)
8
8
  rspec-core (~> 3.0)
9
9
  rspec-expectations (~> 3.0)
10
10
  rspec-mocks (~> 3.0)
@@ -12,53 +12,54 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activemodel (5.0.2)
16
- activesupport (= 5.0.2)
17
- activerecord (5.0.2)
18
- activemodel (= 5.0.2)
19
- activesupport (= 5.0.2)
15
+ activemodel (5.0.7.2)
16
+ activesupport (= 5.0.7.2)
17
+ activerecord (5.0.7.2)
18
+ activemodel (= 5.0.7.2)
19
+ activesupport (= 5.0.7.2)
20
20
  arel (~> 7.0)
21
- activesupport (5.0.2)
21
+ activesupport (5.0.7.2)
22
22
  concurrent-ruby (~> 1.0, >= 1.0.2)
23
- i18n (~> 0.7)
23
+ i18n (>= 0.7, < 2)
24
24
  minitest (~> 5.1)
25
25
  tzinfo (~> 1.1)
26
- appraisal (2.2.0)
26
+ appraisal (2.3.0)
27
27
  bundler
28
28
  rake
29
29
  thor (>= 0.14.0)
30
30
  arel (7.1.4)
31
- concurrent-ruby (1.0.5)
32
- diff-lcs (1.3)
33
- i18n (0.8.1)
34
- minitest (5.10.1)
35
- rake (12.0.0)
36
- rspec-core (3.6.0)
37
- rspec-support (~> 3.6.0)
38
- rspec-expectations (3.6.0)
31
+ concurrent-ruby (1.1.7)
32
+ diff-lcs (1.5.0)
33
+ i18n (1.8.7)
34
+ concurrent-ruby (~> 1.0)
35
+ minitest (5.14.3)
36
+ rake (13.0.3)
37
+ rspec-core (3.11.0)
38
+ rspec-support (~> 3.11.0)
39
+ rspec-expectations (3.11.0)
39
40
  diff-lcs (>= 1.2.0, < 2.0)
40
- rspec-support (~> 3.6.0)
41
- rspec-mocks (3.6.0)
41
+ rspec-support (~> 3.11.0)
42
+ rspec-mocks (3.11.0)
42
43
  diff-lcs (>= 1.2.0, < 2.0)
43
- rspec-support (~> 3.6.0)
44
- rspec-support (3.6.0)
44
+ rspec-support (~> 3.11.0)
45
+ rspec-support (3.11.0)
45
46
  sqlite3 (1.3.13)
46
- thor (0.19.4)
47
+ thor (1.0.1)
47
48
  thread_safe (0.3.6)
48
- tzinfo (1.2.3)
49
+ tzinfo (1.2.9)
49
50
  thread_safe (~> 0.1)
50
51
 
51
52
  PLATFORMS
52
53
  ruby
53
54
 
54
55
  DEPENDENCIES
55
- activemodel (~> 5.0)
56
- activerecord (~> 5.0)
57
- activesupport (~> 5.0)
56
+ activemodel (~> 5.0.0)
57
+ activerecord (~> 5.0.0)
58
+ activesupport (~> 5.0.0)
58
59
  appraisal (~> 2.1)
59
60
  rake
60
61
  remockable!
61
- sqlite3 (~> 1.3.4)
62
+ sqlite3 (~> 1.3.6)
62
63
 
63
64
  BUNDLED WITH
64
- 1.16.1
65
+ 2.3.6
@@ -2,8 +2,8 @@
2
2
 
3
3
  source "https://rubygems.org/"
4
4
 
5
- gem "activemodel", "~> 5.1"
6
- gem "activerecord", "~> 5.1"
7
- gem "activesupport", "~> 5.1"
5
+ gem "activemodel", "~> 5.1.0"
6
+ gem "activerecord", "~> 5.1.0"
7
+ gem "activesupport", "~> 5.1.0"
8
8
 
9
9
  gemspec :path => "../"
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- remockable (0.3.5)
5
- activemodel (>= 4.0, < 5.3)
6
- activerecord (>= 4.0, < 5.3)
7
- activesupport (>= 4.0, < 5.3)
4
+ remockable (0.3.9)
5
+ activemodel (>= 4.0, < 6.2)
6
+ activerecord (>= 4.0, < 6.2)
7
+ activesupport (>= 4.0, < 6.2)
8
8
  rspec-core (~> 3.0)
9
9
  rspec-expectations (~> 3.0)
10
10
  rspec-mocks (~> 3.0)
@@ -12,53 +12,54 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activemodel (5.1.2)
16
- activesupport (= 5.1.2)
17
- activerecord (5.1.2)
18
- activemodel (= 5.1.2)
19
- activesupport (= 5.1.2)
15
+ activemodel (5.1.7)
16
+ activesupport (= 5.1.7)
17
+ activerecord (5.1.7)
18
+ activemodel (= 5.1.7)
19
+ activesupport (= 5.1.7)
20
20
  arel (~> 8.0)
21
- activesupport (5.1.2)
21
+ activesupport (5.1.7)
22
22
  concurrent-ruby (~> 1.0, >= 1.0.2)
23
- i18n (~> 0.7)
23
+ i18n (>= 0.7, < 2)
24
24
  minitest (~> 5.1)
25
25
  tzinfo (~> 1.1)
26
- appraisal (2.2.0)
26
+ appraisal (2.3.0)
27
27
  bundler
28
28
  rake
29
29
  thor (>= 0.14.0)
30
30
  arel (8.0.0)
31
- concurrent-ruby (1.0.5)
32
- diff-lcs (1.3)
33
- i18n (0.8.4)
34
- minitest (5.10.2)
35
- rake (12.0.0)
36
- rspec-core (3.6.0)
37
- rspec-support (~> 3.6.0)
38
- rspec-expectations (3.6.0)
31
+ concurrent-ruby (1.1.7)
32
+ diff-lcs (1.5.0)
33
+ i18n (1.8.7)
34
+ concurrent-ruby (~> 1.0)
35
+ minitest (5.14.3)
36
+ rake (13.0.3)
37
+ rspec-core (3.11.0)
38
+ rspec-support (~> 3.11.0)
39
+ rspec-expectations (3.11.0)
39
40
  diff-lcs (>= 1.2.0, < 2.0)
40
- rspec-support (~> 3.6.0)
41
- rspec-mocks (3.6.0)
41
+ rspec-support (~> 3.11.0)
42
+ rspec-mocks (3.11.0)
42
43
  diff-lcs (>= 1.2.0, < 2.0)
43
- rspec-support (~> 3.6.0)
44
- rspec-support (3.6.0)
45
- sqlite3 (1.3.13)
46
- thor (0.19.4)
44
+ rspec-support (~> 3.11.0)
45
+ rspec-support (3.11.0)
46
+ sqlite3 (1.4.2)
47
+ thor (1.0.1)
47
48
  thread_safe (0.3.6)
48
- tzinfo (1.2.3)
49
+ tzinfo (1.2.9)
49
50
  thread_safe (~> 0.1)
50
51
 
51
52
  PLATFORMS
52
53
  ruby
53
54
 
54
55
  DEPENDENCIES
55
- activemodel (~> 5.1)
56
- activerecord (~> 5.1)
57
- activesupport (~> 5.1)
56
+ activemodel (~> 5.1.0)
57
+ activerecord (~> 5.1.0)
58
+ activesupport (~> 5.1.0)
58
59
  appraisal (~> 2.1)
59
60
  rake
60
61
  remockable!
61
- sqlite3 (~> 1.3.4)
62
+ sqlite3 (~> 1.4.2)
62
63
 
63
64
  BUNDLED WITH
64
- 1.16.1
65
+ 2.3.6
@@ -2,8 +2,8 @@
2
2
 
3
3
  source "https://rubygems.org/"
4
4
 
5
- gem "activemodel", "~> 5.2"
6
- gem "activerecord", "~> 5.2"
7
- gem "activesupport", "~> 5.2"
5
+ gem "activemodel", "~> 5.2.0"
6
+ gem "activerecord", "~> 5.2.0"
7
+ gem "activesupport", "~> 5.2.0"
8
8
 
9
9
  gemspec :path => "../"
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- remockable (0.3.5)
5
- activemodel (>= 4.0, < 5.3)
6
- activerecord (>= 4.0, < 5.3)
7
- activesupport (>= 4.0, < 5.3)
4
+ remockable (0.3.9)
5
+ activemodel (>= 4.0, < 6.2)
6
+ activerecord (>= 4.0, < 6.2)
7
+ activesupport (>= 4.0, < 6.2)
8
8
  rspec-core (~> 3.0)
9
9
  rspec-expectations (~> 3.0)
10
10
  rspec-mocks (~> 3.0)
@@ -12,54 +12,54 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activemodel (5.2.0)
16
- activesupport (= 5.2.0)
17
- activerecord (5.2.0)
18
- activemodel (= 5.2.0)
19
- activesupport (= 5.2.0)
15
+ activemodel (5.2.4.4)
16
+ activesupport (= 5.2.4.4)
17
+ activerecord (5.2.4.4)
18
+ activemodel (= 5.2.4.4)
19
+ activesupport (= 5.2.4.4)
20
20
  arel (>= 9.0)
21
- activesupport (5.2.0)
21
+ activesupport (5.2.4.4)
22
22
  concurrent-ruby (~> 1.0, >= 1.0.2)
23
23
  i18n (>= 0.7, < 2)
24
24
  minitest (~> 5.1)
25
25
  tzinfo (~> 1.1)
26
- appraisal (2.2.0)
26
+ appraisal (2.3.0)
27
27
  bundler
28
28
  rake
29
29
  thor (>= 0.14.0)
30
30
  arel (9.0.0)
31
- concurrent-ruby (1.0.5)
32
- diff-lcs (1.3)
33
- i18n (1.0.1)
31
+ concurrent-ruby (1.1.7)
32
+ diff-lcs (1.5.0)
33
+ i18n (1.8.7)
34
34
  concurrent-ruby (~> 1.0)
35
- minitest (5.11.3)
36
- rake (12.3.1)
37
- rspec-core (3.7.1)
38
- rspec-support (~> 3.7.0)
39
- rspec-expectations (3.7.0)
35
+ minitest (5.14.3)
36
+ rake (13.0.3)
37
+ rspec-core (3.11.0)
38
+ rspec-support (~> 3.11.0)
39
+ rspec-expectations (3.11.0)
40
40
  diff-lcs (>= 1.2.0, < 2.0)
41
- rspec-support (~> 3.7.0)
42
- rspec-mocks (3.7.0)
41
+ rspec-support (~> 3.11.0)
42
+ rspec-mocks (3.11.0)
43
43
  diff-lcs (>= 1.2.0, < 2.0)
44
- rspec-support (~> 3.7.0)
45
- rspec-support (3.7.1)
46
- sqlite3 (1.3.13)
47
- thor (0.20.0)
44
+ rspec-support (~> 3.11.0)
45
+ rspec-support (3.11.0)
46
+ sqlite3 (1.4.2)
47
+ thor (1.0.1)
48
48
  thread_safe (0.3.6)
49
- tzinfo (1.2.5)
49
+ tzinfo (1.2.9)
50
50
  thread_safe (~> 0.1)
51
51
 
52
52
  PLATFORMS
53
53
  ruby
54
54
 
55
55
  DEPENDENCIES
56
- activemodel (~> 5.2)
57
- activerecord (~> 5.2)
58
- activesupport (~> 5.2)
56
+ activemodel (~> 5.2.0)
57
+ activerecord (~> 5.2.0)
58
+ activesupport (~> 5.2.0)
59
59
  appraisal (~> 2.1)
60
60
  rake
61
61
  remockable!
62
- sqlite3 (~> 1.3.4)
62
+ sqlite3 (~> 1.4.2)
63
63
 
64
64
  BUNDLED WITH
65
- 1.16.1
65
+ 2.3.6
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org/"
4
+
5
+ gem "activemodel", "~> 6.0.0"
6
+ gem "activerecord", "~> 6.0.0"
7
+ gem "activesupport", "~> 6.0.0"
8
+
9
+ gemspec :path => "../"
@@ -0,0 +1,65 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ remockable (0.3.9)
5
+ activemodel (>= 4.0, < 6.2)
6
+ activerecord (>= 4.0, < 6.2)
7
+ activesupport (>= 4.0, < 6.2)
8
+ rspec-core (~> 3.0)
9
+ rspec-expectations (~> 3.0)
10
+ rspec-mocks (~> 3.0)
11
+
12
+ GEM
13
+ remote: https://rubygems.org/
14
+ specs:
15
+ activemodel (6.0.3.4)
16
+ activesupport (= 6.0.3.4)
17
+ activerecord (6.0.3.4)
18
+ activemodel (= 6.0.3.4)
19
+ activesupport (= 6.0.3.4)
20
+ activesupport (6.0.3.4)
21
+ concurrent-ruby (~> 1.0, >= 1.0.2)
22
+ i18n (>= 0.7, < 2)
23
+ minitest (~> 5.1)
24
+ tzinfo (~> 1.1)
25
+ zeitwerk (~> 2.2, >= 2.2.2)
26
+ appraisal (2.3.0)
27
+ bundler
28
+ rake
29
+ thor (>= 0.14.0)
30
+ concurrent-ruby (1.1.7)
31
+ diff-lcs (1.5.0)
32
+ i18n (1.8.7)
33
+ concurrent-ruby (~> 1.0)
34
+ minitest (5.14.3)
35
+ rake (13.0.3)
36
+ rspec-core (3.11.0)
37
+ rspec-support (~> 3.11.0)
38
+ rspec-expectations (3.11.0)
39
+ diff-lcs (>= 1.2.0, < 2.0)
40
+ rspec-support (~> 3.11.0)
41
+ rspec-mocks (3.11.0)
42
+ diff-lcs (>= 1.2.0, < 2.0)
43
+ rspec-support (~> 3.11.0)
44
+ rspec-support (3.11.0)
45
+ sqlite3 (1.4.2)
46
+ thor (1.0.1)
47
+ thread_safe (0.3.6)
48
+ tzinfo (1.2.9)
49
+ thread_safe (~> 0.1)
50
+ zeitwerk (2.4.2)
51
+
52
+ PLATFORMS
53
+ ruby
54
+
55
+ DEPENDENCIES
56
+ activemodel (~> 6.0.0)
57
+ activerecord (~> 6.0.0)
58
+ activesupport (~> 6.0.0)
59
+ appraisal (~> 2.1)
60
+ rake
61
+ remockable!
62
+ sqlite3 (~> 1.4.2)
63
+
64
+ BUNDLED WITH
65
+ 2.3.6
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org/"
4
+
5
+ gem "activemodel", "~> 6.1.0"
6
+ gem "activerecord", "~> 6.1.0"
7
+ gem "activesupport", "~> 6.1.0"
8
+
9
+ gemspec :path => "../"
@@ -0,0 +1,64 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ remockable (0.3.9)
5
+ activemodel (>= 4.0, < 6.2)
6
+ activerecord (>= 4.0, < 6.2)
7
+ activesupport (>= 4.0, < 6.2)
8
+ rspec-core (~> 3.0)
9
+ rspec-expectations (~> 3.0)
10
+ rspec-mocks (~> 3.0)
11
+
12
+ GEM
13
+ remote: https://rubygems.org/
14
+ specs:
15
+ activemodel (6.1.1)
16
+ activesupport (= 6.1.1)
17
+ activerecord (6.1.1)
18
+ activemodel (= 6.1.1)
19
+ activesupport (= 6.1.1)
20
+ activesupport (6.1.1)
21
+ concurrent-ruby (~> 1.0, >= 1.0.2)
22
+ i18n (>= 1.6, < 2)
23
+ minitest (>= 5.1)
24
+ tzinfo (~> 2.0)
25
+ zeitwerk (~> 2.3)
26
+ appraisal (2.3.0)
27
+ bundler
28
+ rake
29
+ thor (>= 0.14.0)
30
+ concurrent-ruby (1.1.7)
31
+ diff-lcs (1.5.0)
32
+ i18n (1.8.7)
33
+ concurrent-ruby (~> 1.0)
34
+ minitest (5.14.3)
35
+ rake (13.0.3)
36
+ rspec-core (3.11.0)
37
+ rspec-support (~> 3.11.0)
38
+ rspec-expectations (3.11.0)
39
+ diff-lcs (>= 1.2.0, < 2.0)
40
+ rspec-support (~> 3.11.0)
41
+ rspec-mocks (3.11.0)
42
+ diff-lcs (>= 1.2.0, < 2.0)
43
+ rspec-support (~> 3.11.0)
44
+ rspec-support (3.11.0)
45
+ sqlite3 (1.4.2)
46
+ thor (1.0.1)
47
+ tzinfo (2.0.4)
48
+ concurrent-ruby (~> 1.0)
49
+ zeitwerk (2.4.2)
50
+
51
+ PLATFORMS
52
+ ruby
53
+
54
+ DEPENDENCIES
55
+ activemodel (~> 6.1.0)
56
+ activerecord (~> 6.1.0)
57
+ activesupport (~> 6.1.0)
58
+ appraisal (~> 2.1)
59
+ rake
60
+ remockable!
61
+ sqlite3 (~> 1.4.2)
62
+
63
+ BUNDLED WITH
64
+ 2.3.6
@@ -19,8 +19,19 @@ RSpec::Matchers.define(:belong_to) do
19
19
 
20
20
  match do |actual|
21
21
  if association = subject.class.reflect_on_association(attribute)
22
+ if ActiveRecord.version > Gem::Version.new('5.0')
23
+ if options.key?(:required)
24
+ options[:optional] = !options.delete(:required)
25
+ end
26
+ else
27
+ if options.key?(:optional)
28
+ options[:required] = !options.delete(:optional)
29
+ end
30
+ end
31
+
22
32
  macro_matches = association.macro == :belongs_to
23
33
  options_match = association.options.slice(*options.keys) == options
34
+
24
35
  macro_matches && options_match
25
36
  end
26
37
  end
@@ -1,15 +1,14 @@
1
1
  RSpec::Matchers.define(:have_index) do
2
2
  include Remockable::ActiveRecord::Helpers
3
3
 
4
- valid_options %w(name unique)
4
+ valid_options %w(name unique where)
5
5
 
6
6
  def column_names
7
7
  @column_names ||= expected_as_array.flatten.collect(&:to_s)
8
8
  end
9
9
 
10
10
  match do |actual|
11
- name = options[:name]
12
- unique = options[:unique]
11
+ name, unique, where = options.values_at(:name, :unique, :where)
13
12
  indexes = ActiveRecord::Base.connection.indexes(subject.class.table_name)
14
13
 
15
14
  index = indexes.detect do |index|
@@ -23,8 +22,9 @@ RSpec::Matchers.define(:have_index) do
23
22
  if index
24
23
  name_matches = name.nil? || matches_name?(index, name)
25
24
  unique_matches = unique.nil? || index.unique == unique
25
+ where_matches = where.nil? || index.where == where
26
26
 
27
- name_matches && unique_matches
27
+ name_matches && unique_matches && where_matches
28
28
  end
29
29
  end
30
30
 
@@ -1,3 +1,3 @@
1
1
  module Remockable
2
- VERSION = '0.3.6'
2
+ VERSION = '0.3.9'
3
3
  end
data/remockable.gemspec CHANGED
@@ -8,15 +8,15 @@ Gem::Specification.new do |spec|
8
8
  spec.homepage = 'http://github.com/tylerhunt/remockable'
9
9
  spec.license = 'MIT'
10
10
 
11
- spec.add_dependency 'activemodel', '>= 4.0', '< 5.3'
12
- spec.add_dependency 'activerecord', '>= 4.0', '< 5.3'
13
- spec.add_dependency 'activesupport', '>= 4.0', '< 5.3'
11
+ spec.add_dependency 'activemodel', '>= 4.0', '< 6.2'
12
+ spec.add_dependency 'activerecord', '>= 4.0', '< 6.2'
13
+ spec.add_dependency 'activesupport', '>= 4.0', '< 6.2'
14
14
  spec.add_dependency 'rspec-core', '~> 3.0'
15
15
  spec.add_dependency 'rspec-expectations', '~> 3.0'
16
16
  spec.add_dependency 'rspec-mocks', '~> 3.0'
17
17
  spec.add_development_dependency 'appraisal', '~> 2.1'
18
18
  spec.add_development_dependency 'rake'
19
- spec.add_development_dependency 'sqlite3', '~> 1.3.4'
19
+ spec.add_development_dependency 'sqlite3', '~> 1.4.2'
20
20
 
21
21
  spec.files = `git ls-files`.split($/)
22
22
  spec.executables = spec.files.grep(%r{^bin/}) { |file| File.basename(file) }
@@ -1,7 +1,13 @@
1
1
  describe :allow_values_for do
2
2
  let(:attribute) { :one }
3
3
  let(:values) { ['123'] }
4
- let(:matcher_name) { self.class.parent.description }
4
+ let(:matcher_name) do
5
+ if self.class.respond_to?(:module_parent)
6
+ self.class.module_parent.description
7
+ else
8
+ self.class.parent.description
9
+ end
10
+ end
5
11
 
6
12
  let(:model) {
7
13
  build_class :User do
@@ -44,7 +44,10 @@ describe :belong_to do
44
44
 
45
45
  with_option :class_name, 'Company', 'Organization'
46
46
  with_option :foreign_key, :company_id, :organization_id
47
- with_option :foreign_type, :company_type, :organization_type
47
+ with_option :foreign_type,
48
+ :company_type,
49
+ :organization_type,
50
+ polymorphic: true
48
51
  with_option :primary_key, :id, :company_id
49
52
  with_option :dependent, :destroy, :nullify
50
53
  with_option :counter_cache, true, false
@@ -55,9 +58,11 @@ describe :belong_to do
55
58
  with_option :inverse_of, :users, :employees
56
59
 
57
60
  if ActiveRecord.version > Gem::Version.new('5.0')
61
+ with_option :required, false, true
58
62
  with_option :optional, true, false
59
63
  else
60
64
  with_option :required, true, false
65
+ with_option :optional, false, true, {}, required: true
61
66
  end
62
67
  end
63
68
  end
@@ -45,6 +45,28 @@ describe :have_index do
45
45
  end
46
46
  end
47
47
 
48
+ context 'with option :name' do
49
+ it 'matches if the index exists' do
50
+ ActiveRecord::Base.connection.add_index :users, :one, name: :oneness
51
+ expect(model).to have_index :one, name: :oneness
52
+ end
53
+
54
+ it 'does not match if the index does not exist' do
55
+ expect(model).to_not have_index :one, name: :oneness
56
+ end
57
+ end
58
+
59
+ context 'with option :name and without :one' do
60
+ it 'matches if the index exists' do
61
+ ActiveRecord::Base.connection.add_index :users, :one, name: :oneness
62
+ expect(model).to have_index name: :oneness
63
+ end
64
+
65
+ it 'does not match if the index does not exist' do
66
+ expect(model).to_not have_index name: :oneness
67
+ end
68
+ end
69
+
48
70
  context 'with option :unique' do
49
71
  it 'matches if the index exists' do
50
72
  ActiveRecord::Base.connection.add_index :users, :one, unique: true
@@ -61,25 +83,19 @@ describe :have_index do
61
83
  end
62
84
  end
63
85
 
64
- context 'with option :name' do
86
+ context 'with option :where' do
65
87
  it 'matches if the index exists' do
66
- ActiveRecord::Base.connection.add_index :users, :one, name: :oneness
67
- expect(model).to have_index :one, name: :oneness
88
+ ActiveRecord::Base.connection.add_index :users, :one, where: 'two = 2'
89
+ expect(model).to have_index :one, where: 'two = 2'
68
90
  end
69
91
 
70
- it 'does not match if the index does not exist' do
71
- expect(model).to_not have_index :one, name: :oneness
72
- end
73
- end
74
-
75
- context 'with option :name and without :one' do
76
- it 'matches if the index exists' do
77
- ActiveRecord::Base.connection.add_index :users, :one, name: :oneness
78
- expect(model).to have_index name: :oneness
92
+ it 'does not match if the index conditions are different' do
93
+ ActiveRecord::Base.connection.add_index :users, :one, where: 'two = 2'
94
+ expect(model).to_not have_index :one, where: 'two = 1'
79
95
  end
80
96
 
81
97
  it 'does not match if the index does not exist' do
82
- expect(model).to_not have_index name: :oneness
98
+ expect(model).to_not have_index :one, where: 'two = 2'
83
99
  end
84
100
  end
85
101
  end
@@ -47,8 +47,8 @@ describe :have_many do
47
47
  with_option(:counter_cache, :post_count, :posts_count)
48
48
  with_option(:as, :postable, :bloggable)
49
49
  with_option(:through, :postings, :bloggings)
50
- with_option(:source, :piece, :work)
51
- with_option(:source_type, 'Post', 'Blog')
50
+ with_option(:source, :piece, :work, through: :postings)
51
+ with_option(:source_type, 'Post', 'Blog', through: :postings)
52
52
  with_option(:validate, true, false)
53
53
  with_option(:autosave, true, false)
54
54
  with_option(:inverse_of, :users, :employees)
@@ -14,7 +14,7 @@ class_builder = Module.new do
14
14
  def create_table(table_name, options={}, &block)
15
15
  begin
16
16
  drop_table table_name
17
- ActiveRecord::Base.connection.create_table table_name, options, &block
17
+ ActiveRecord::Base.connection.create_table table_name, **options, &block
18
18
  created_tables << table_name
19
19
  rescue
20
20
  drop_table table_name
@@ -1,7 +1,13 @@
1
1
  shared_examples_for 'a validation matcher' do
2
2
  let(:attribute) { :one }
3
3
  let(:options) { default_options }
4
- let(:matcher_name) { self.class.parent.parent.description }
4
+ let(:matcher_name) do
5
+ if self.class.respond_to?(:module_parent)
6
+ self.class.module_parent.module_parent.description
7
+ else
8
+ self.class.parent.parent.description
9
+ end
10
+ end
5
11
 
6
12
  let(:model) {
7
13
  build_class :User do
@@ -1,12 +1,24 @@
1
1
  shared_examples_for 'an Active Record matcher' do
2
- let(:matcher_name) { self.class.parent.parent.description }
2
+ let(:matcher_name) do
3
+ if self.class.respond_to?(:module_parent)
4
+ self.class.module_parent.module_parent.description
5
+ else
6
+ self.class.parent.parent.description
7
+ end
8
+ end
3
9
 
4
- def self.with_option(option_name, positive, negative, context={})
10
+ def self.with_option(
11
+ option_name,
12
+ positive,
13
+ negative,
14
+ context={},
15
+ macro_option={ option_name => positive }
16
+ )
5
17
  context "with option #{option_name.inspect}" do
6
- let(:options) { [:company, context.merge(option_name => positive)] }
18
+ let(:options) { context.merge(macro_option) }
7
19
 
8
20
  before do
9
- model.send macro, *options
21
+ model.send macro, :company, **options
10
22
  end
11
23
 
12
24
  it 'matches if the options match' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remockable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Hunt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-07 00:00:00.000000000 Z
11
+ date: 2022-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '4.0'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '5.3'
22
+ version: '6.2'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '4.0'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '5.3'
32
+ version: '6.2'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: activerecord
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: '4.0'
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
- version: '5.3'
42
+ version: '6.2'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,7 +49,7 @@ dependencies:
49
49
  version: '4.0'
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
- version: '5.3'
52
+ version: '6.2'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: activesupport
55
55
  requirement: !ruby/object:Gem::Requirement
@@ -59,7 +59,7 @@ dependencies:
59
59
  version: '4.0'
60
60
  - - "<"
61
61
  - !ruby/object:Gem::Version
62
- version: '5.3'
62
+ version: '6.2'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
@@ -69,7 +69,7 @@ dependencies:
69
69
  version: '4.0'
70
70
  - - "<"
71
71
  - !ruby/object:Gem::Version
72
- version: '5.3'
72
+ version: '6.2'
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: rspec-core
75
75
  requirement: !ruby/object:Gem::Requirement
@@ -146,23 +146,23 @@ dependencies:
146
146
  requirements:
147
147
  - - "~>"
148
148
  - !ruby/object:Gem::Version
149
- version: 1.3.4
149
+ version: 1.4.2
150
150
  type: :development
151
151
  prerelease: false
152
152
  version_requirements: !ruby/object:Gem::Requirement
153
153
  requirements:
154
154
  - - "~>"
155
155
  - !ruby/object:Gem::Version
156
- version: 1.3.4
156
+ version: 1.4.2
157
157
  description:
158
158
  email:
159
159
  executables: []
160
160
  extensions: []
161
161
  extra_rdoc_files: []
162
162
  files:
163
+ - ".github/workflows/build.yml"
163
164
  - ".gitignore"
164
165
  - ".rspec"
165
- - ".travis.yml"
166
166
  - Appraisals
167
167
  - CHANGELOG.md
168
168
  - Gemfile
@@ -177,6 +177,10 @@ files:
177
177
  - gemfiles/rails_5.1.gemfile.lock
178
178
  - gemfiles/rails_5.2.gemfile
179
179
  - gemfiles/rails_5.2.gemfile.lock
180
+ - gemfiles/rails_6.0.gemfile
181
+ - gemfiles/rails_6.0.gemfile.lock
182
+ - gemfiles/rails_6.1.gemfile
183
+ - gemfiles/rails_6.1.gemfile.lock
180
184
  - lib/remockable.rb
181
185
  - lib/remockable/active_model.rb
182
186
  - lib/remockable/active_model/allow_values_for.rb
@@ -249,8 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
249
253
  - !ruby/object:Gem::Version
250
254
  version: '0'
251
255
  requirements: []
252
- rubyforge_project:
253
- rubygems_version: 2.7.6
256
+ rubygems_version: 3.3.6
254
257
  signing_key:
255
258
  specification_version: 4
256
259
  summary: A collection of RSpec matchers for web apps.
data/.travis.yml DELETED
@@ -1,32 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- script: bundle exec rspec
4
- sudo: false
5
-
6
- gemfile:
7
- - gemfiles/rails_4.2.gemfile
8
- - gemfiles/rails_5.0.gemfile
9
- - gemfiles/rails_5.1.gemfile
10
- - gemfiles/rails_5.2.gemfile
11
-
12
- rvm:
13
- - 2.0.0
14
- - 2.1.10
15
- - 2.2.8
16
- - 2.3.5
17
- - 2.4.2
18
-
19
- matrix:
20
- exclude:
21
- - rvm: 2.0.0
22
- gemfile: gemfiles/rails_5.0.gemfile
23
- - rvm: 2.0.0
24
- gemfile: gemfiles/rails_5.1.gemfile
25
- - rvm: 2.0.0
26
- gemfile: gemfiles/rails_5.2.gemfile
27
- - rvm: 2.1.10
28
- gemfile: gemfiles/rails_5.0.gemfile
29
- - rvm: 2.1.10
30
- gemfile: gemfiles/rails_5.1.gemfile
31
- - rvm: 2.1.10
32
- gemfile: gemfiles/rails_5.2.gemfile