mongoid-rspec 2.1.0 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/LICENSE +1 -1
- data/README.md +222 -102
- data/Rakefile +8 -5
- data/lib/matchers/accept_nested_attributes.rb +22 -23
- data/lib/matchers/allow_mass_assignment.rb +12 -12
- data/lib/matchers/associations.rb +85 -49
- data/lib/matchers/be_dynamic_document.rb +26 -0
- data/lib/matchers/be_mongoid_document.rb +26 -0
- data/lib/matchers/be_stored_in.rb +55 -0
- data/lib/matchers/have_field.rb +90 -0
- data/lib/matchers/have_timestamps.rb +61 -0
- data/lib/matchers/indexes/have_index_for.rb +16 -0
- data/lib/matchers/indexes/v3/have_index_for.rb +59 -0
- data/lib/matchers/indexes/v4/have_index_for.rb +54 -0
- data/lib/matchers/validations.rb +30 -11
- data/lib/matchers/validations/absence_of.rb +11 -0
- data/lib/matchers/validations/associated.rb +1 -1
- data/lib/matchers/validations/confirmation_of.rb +7 -1
- data/lib/matchers/validations/custom_validation_of.rb +1 -4
- data/lib/matchers/validations/exclusion_of.rb +5 -5
- data/lib/matchers/validations/format_of.rb +2 -2
- data/lib/matchers/validations/inclusion_of.rb +5 -5
- data/lib/matchers/validations/length_of.rb +13 -35
- data/lib/matchers/validations/numericality_of.rb +32 -16
- data/lib/matchers/validations/presence_of.rb +1 -1
- data/lib/matchers/validations/uniqueness_of.rb +7 -10
- data/lib/mongoid-rspec.rb +1 -33
- data/lib/mongoid/rspec.rb +46 -0
- data/lib/mongoid/rspec/version.rb +5 -0
- data/spec/models/article.rb +9 -6
- data/spec/models/comment.rb +1 -1
- data/spec/models/log.rb +3 -3
- data/spec/models/message.rb +17 -0
- data/spec/models/movie_article.rb +1 -2
- data/spec/models/person.rb +1 -1
- data/spec/models/profile.rb +2 -2
- data/spec/models/record.rb +1 -1
- data/spec/models/site.rb +5 -1
- data/spec/models/user.rb +12 -10
- data/spec/spec_helper.rb +12 -10
- data/spec/unit/accept_nested_attributes_spec.rb +1 -1
- data/spec/unit/associations_spec.rb +19 -7
- data/spec/unit/be_dynamic_document_spec.rb +21 -0
- data/spec/unit/be_mongoid_document_spec.rb +25 -0
- data/spec/unit/be_stored_in.rb +54 -0
- data/spec/unit/document_spec.rb +5 -14
- data/spec/unit/have_index_for_spec.rb +46 -0
- data/spec/unit/have_timestamps_spec.rb +71 -0
- data/spec/unit/validations_spec.rb +23 -14
- data/spec/validators/ssn_validator.rb +6 -6
- metadata +119 -43
- data/.document +0 -5
- data/.gitignore +0 -6
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
- data/.travis.yml +0 -10
- data/Gemfile +0 -4
- data/lib/matchers/collections.rb +0 -9
- data/lib/matchers/document.rb +0 -173
- data/lib/matchers/indexes.rb +0 -69
- data/lib/matchers/validations/with_message.rb +0 -27
- data/lib/mongoid-rspec/version.rb +0 -5
- data/mongoid-rspec.gemspec +0 -25
- data/spec/unit/collections_spec.rb +0 -7
- data/spec/unit/indexes_spec.rb +0 -17
@@ -1,14 +1,16 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
RSpec.describe
|
3
|
+
RSpec.describe 'Associations' do
|
4
4
|
describe User do
|
5
|
-
|
5
|
+
if Mongoid::Compatibility::Version.mongoid6_or_newer?
|
6
|
+
it { is_expected.to have_many(:articles).with_foreign_key(:author_id).ordered_by(:title) }
|
7
|
+
end
|
6
8
|
|
7
|
-
it { is_expected.to have_one(:record).with_autobuild }
|
9
|
+
it { is_expected.to have_one(:record).as_inverse_of(:user).with_autobuild }
|
8
10
|
|
9
11
|
it { is_expected.to have_many(:comments).with_dependent(:destroy).with_autosave }
|
10
12
|
|
11
|
-
it { is_expected.to embed_one(:profile) }
|
13
|
+
it { is_expected.to embed_one(:profile).as_inverse_of(:user) }
|
12
14
|
|
13
15
|
it { is_expected.to have_and_belong_to_many(:children).of_type(User) }
|
14
16
|
end
|
@@ -19,8 +21,8 @@ RSpec.describe "Associations" do
|
|
19
21
|
|
20
22
|
describe Article do
|
21
23
|
it { is_expected.to belong_to(:author).of_type(User).as_inverse_of(:articles).with_index }
|
22
|
-
it { is_expected.to embed_many(:comments).with_cascading_callbacks }
|
23
|
-
it { is_expected.to embed_one(:permalink) }
|
24
|
+
it { is_expected.to embed_many(:comments).as_inverse_of(:article).with_cascading_callbacks }
|
25
|
+
it { is_expected.to embed_one(:permalink).as_inverse_of(:linkable) }
|
24
26
|
end
|
25
27
|
|
26
28
|
describe Comment do
|
@@ -37,6 +39,16 @@ RSpec.describe "Associations" do
|
|
37
39
|
end
|
38
40
|
|
39
41
|
describe Site do
|
40
|
-
|
42
|
+
if Mongoid::Compatibility::Version.mongoid6_or_older?
|
43
|
+
it { is_expected.to have_many(:users).as_inverse_of(:site).ordered_by(:email.desc).with_counter_cache }
|
44
|
+
elsif Mongoid::Compatibility::Version.mongoid7_or_newer?
|
45
|
+
it { is_expected.to have_many(:users).as_inverse_of(:site).ordered_by(:email.desc) }
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
describe Message do
|
50
|
+
if Mongoid::Compatibility::Version.mongoid6_or_newer?
|
51
|
+
it { is_expected.to belong_to(:user).with_optional }
|
52
|
+
end
|
41
53
|
end
|
42
54
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Mongoid::Matchers::BeDynamicDocument do
|
4
|
+
context 'when model does\'t include Mongoid::Document' do
|
5
|
+
subject do
|
6
|
+
Class.new
|
7
|
+
end
|
8
|
+
|
9
|
+
it { is_expected.not_to be_mongoid_document }
|
10
|
+
end
|
11
|
+
|
12
|
+
context 'when model doesn\'t include Mongoid::Document' do
|
13
|
+
subject do
|
14
|
+
Class.new do
|
15
|
+
include Mongoid::Document
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
it { is_expected.to be_mongoid_document }
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
if Mongoid::Compatibility::Version.mongoid4_or_newer?
|
3
|
+
RSpec.describe Mongoid::Matchers::BeMongoidDocument do
|
4
|
+
context 'when model does\'t include Mongoid::Attributes::Dynamic' do
|
5
|
+
subject do
|
6
|
+
Class.new do
|
7
|
+
include Mongoid::Document
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
it { is_expected.not_to be_dynamic_document }
|
12
|
+
end
|
13
|
+
|
14
|
+
context 'when model doesn\'t include Mongoid::Attributes::Dynamic' do
|
15
|
+
subject do
|
16
|
+
Class.new do
|
17
|
+
include Mongoid::Document
|
18
|
+
include Mongoid::Attributes::Dynamic
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
it { is_expected.to be_dynamic_document }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Mongoid::Matchers::BeStoredIn do
|
4
|
+
subject do
|
5
|
+
Class.new do
|
6
|
+
include Mongoid::Document
|
7
|
+
store_in collection: 'citizens', database: 'other', client: 'secondary'
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'detects storage options' do
|
12
|
+
is_expected.to be_stored_in(collection: 'citizens', database: 'other', client: 'secondary')
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'detects even part of storage options' do
|
16
|
+
is_expected.to be_stored_in(database: 'other')
|
17
|
+
is_expected.to be_stored_in(client: 'secondary')
|
18
|
+
is_expected.to be_stored_in(collection: 'citizens')
|
19
|
+
is_expected.to be_stored_in(collection: 'citizens', database: 'other')
|
20
|
+
is_expected.to be_stored_in(database: 'other', client: 'secondary')
|
21
|
+
is_expected.to be_stored_in(collection: 'citizens', client: 'secondary')
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'detects differences' do
|
25
|
+
is_expected.not_to be_stored_in(collection: 'aliens')
|
26
|
+
end
|
27
|
+
|
28
|
+
context 'when models has storage options defined via blocks, procs or lambdas' do
|
29
|
+
subject do
|
30
|
+
Class.new do
|
31
|
+
include Mongoid::Document
|
32
|
+
store_in database: -> { Thread.current[:database] }
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
before do
|
37
|
+
Thread.current[:database] = 'db1981'
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'detects storage options' do
|
41
|
+
is_expected.to be_stored_in(database: 'db1981')
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'reflects changes in storage options' do
|
45
|
+
is_expected.to be_stored_in(database: 'db1981')
|
46
|
+
Thread.current[:database] = 'db2200'
|
47
|
+
is_expected.to be_stored_in(database: 'db2200')
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'detects differences' do
|
51
|
+
is_expected.not_to be_stored_in(database: 'other')
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
data/spec/unit/document_spec.rb
CHANGED
@@ -1,26 +1,17 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
RSpec.describe
|
3
|
+
RSpec.describe 'Document' do
|
4
4
|
describe User do
|
5
5
|
it { is_expected.to have_fields(:email, :login) }
|
6
|
-
it { is_expected.to be_timestamped_document }
|
7
|
-
it { is_expected.to be_timestamped_document.with(:created) }
|
8
|
-
it { is_expected.not_to be_timestamped_document.with(:updated) }
|
9
6
|
end
|
10
7
|
|
11
8
|
describe Article do
|
12
|
-
|
13
|
-
it { is_expected.to have_field(:
|
9
|
+
klass_boolean = Mongoid::Compatibility::Version.mongoid4_or_newer? ? Mongoid::Boolean : Boolean
|
10
|
+
it { is_expected.to have_field(:published).of_type(klass_boolean).with_default_value_of(false) }
|
11
|
+
it { is_expected.to have_field(:allow_comments).of_type(klass_boolean).with_default_value_of(true) }
|
14
12
|
it { is_expected.to belong_to(:author) }
|
15
13
|
it { is_expected.to have_field(:title).localized }
|
16
|
-
it { is_expected.not_to have_field(:allow_comments).of_type(
|
14
|
+
it { is_expected.not_to have_field(:allow_comments).of_type(klass_boolean).with_default_value_of(false) }
|
17
15
|
it { is_expected.not_to have_field(:number_of_comments).of_type(Integer).with_default_value_of(1) }
|
18
|
-
it { is_expected.to be_mongoid_document }
|
19
|
-
it { is_expected.to be_timestamped_document }
|
20
|
-
end
|
21
|
-
|
22
|
-
describe Log do
|
23
|
-
it { is_expected.to be_mongoid_document }
|
24
|
-
it { is_expected.to be_dynamic_document }
|
25
16
|
end
|
26
17
|
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Mongoid::Matchers::HaveIndexFor do
|
4
|
+
subject do
|
5
|
+
Class.new do
|
6
|
+
include Mongoid::Document
|
7
|
+
|
8
|
+
field :fizz, as: :buzz, type: String
|
9
|
+
|
10
|
+
index(foo: 1)
|
11
|
+
index({ bar: 1 }, unique: true, background: true, drop_dups: true)
|
12
|
+
index(foo: 1, bar: -1)
|
13
|
+
index('baz._id' => 1)
|
14
|
+
index(buzz: 1)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'detects an index for singular field key' do
|
19
|
+
is_expected.to have_index_for(foo: 1)
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'detects an index for multipple fields key' do
|
23
|
+
is_expected.to have_index_for(foo: 1, bar: -1)
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'detects an index with options' do
|
27
|
+
is_expected
|
28
|
+
.to have_index_for(bar: 1)
|
29
|
+
.with_options(unique: true, background: true, drop_dups: true)
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'detects an index with only part of options' do
|
33
|
+
is_expected
|
34
|
+
.to have_index_for(bar: 1)
|
35
|
+
.with_options(unique: true)
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'detects an index for string key' do
|
39
|
+
is_expected.to have_index_for('baz._id' => 1)
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'detect an index for aliased fields' do
|
43
|
+
is_expected.to have_index_for(fizz: 1)
|
44
|
+
is_expected.to have_index_for(buzz: 1) if Mongoid::Compatibility::Version.mongoid4_or_newer?
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Mongoid::Matchers::HaveTimestamps do
|
4
|
+
context 'when model includes Mongoid::Timestamps' do
|
5
|
+
subject do
|
6
|
+
Class.new do
|
7
|
+
include Mongoid::Document
|
8
|
+
include Mongoid::Timestamps
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
it { is_expected.to have_timestamps }
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'when model includes Mongoid::Timestamps::Short' do
|
16
|
+
subject do
|
17
|
+
Class.new do
|
18
|
+
include Mongoid::Document
|
19
|
+
include Mongoid::Timestamps::Short
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
it { is_expected.to have_timestamps.shortened }
|
24
|
+
end
|
25
|
+
|
26
|
+
context 'when model includes Mongoid::Timestamps::Updated' do
|
27
|
+
subject do
|
28
|
+
Class.new do
|
29
|
+
include Mongoid::Document
|
30
|
+
include Mongoid::Timestamps::Updated
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
it { is_expected.to have_timestamps.for(:updating) }
|
35
|
+
end
|
36
|
+
|
37
|
+
context 'when model includes Mongoid::Timestamps::Updated::Short' do
|
38
|
+
subject do
|
39
|
+
Class.new do
|
40
|
+
include Mongoid::Document
|
41
|
+
include Mongoid::Timestamps::Updated::Short
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
it { is_expected.to have_timestamps.for(:updating).shortened }
|
46
|
+
it { is_expected.to have_timestamps.shortened.for(:updating) }
|
47
|
+
end
|
48
|
+
|
49
|
+
context 'when model includes Mongoid::Timestamps::Created' do
|
50
|
+
subject do
|
51
|
+
Class.new do
|
52
|
+
include Mongoid::Document
|
53
|
+
include Mongoid::Timestamps::Created
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
it { is_expected.to have_timestamps.for(:creating) }
|
58
|
+
end
|
59
|
+
|
60
|
+
context 'when model includes Mongoid::Timestamps::Created::Short' do
|
61
|
+
subject do
|
62
|
+
Class.new do
|
63
|
+
include Mongoid::Document
|
64
|
+
include Mongoid::Timestamps::Created::Short
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
it { is_expected.to have_timestamps.for(:creating).shortened }
|
69
|
+
it { is_expected.to have_timestamps.shortened.for(:creating) }
|
70
|
+
end
|
71
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
RSpec.describe
|
3
|
+
RSpec.describe 'Validations' do
|
4
4
|
describe Site do
|
5
5
|
it { is_expected.to validate_presence_of(:name) }
|
6
6
|
it { is_expected.to validate_uniqueness_of(:name) }
|
@@ -9,44 +9,53 @@ RSpec.describe "Validations" do
|
|
9
9
|
describe User do
|
10
10
|
it { is_expected.to validate_presence_of(:login) }
|
11
11
|
it { is_expected.to validate_uniqueness_of(:login).scoped_to(:site) }
|
12
|
-
it { is_expected.to validate_uniqueness_of(:email).case_insensitive.with_message(
|
13
|
-
it { is_expected.to validate_format_of(:login).to_allow(
|
12
|
+
it { is_expected.to validate_uniqueness_of(:email).case_insensitive.with_message('is already taken') }
|
13
|
+
it { is_expected.to validate_format_of(:login).to_allow('valid_login').not_to_allow('invalid login') }
|
14
14
|
it { is_expected.to validate_associated(:profile) }
|
15
|
-
it { is_expected.to validate_exclusion_of(:login).to_not_allow(
|
16
|
-
it { is_expected.to validate_exclusion_of(:password).to_not_allow(
|
17
|
-
it { is_expected.to validate_inclusion_of(:role).to_allow(
|
18
|
-
it { is_expected.to validate_inclusion_of(:role).to_allow([
|
15
|
+
it { is_expected.to validate_exclusion_of(:login).to_not_allow('super', 'index', 'edit') }
|
16
|
+
it { is_expected.to validate_exclusion_of(:password).to_not_allow('password') }
|
17
|
+
it { is_expected.to validate_inclusion_of(:role).to_allow('admin', 'member') }
|
18
|
+
it { is_expected.to validate_inclusion_of(:role).to_allow(%w[admin member]) }
|
19
19
|
it { is_expected.to validate_confirmation_of(:email) }
|
20
20
|
it { is_expected.to validate_presence_of(:age).on(:create, :update) }
|
21
21
|
it { is_expected.to validate_numericality_of(:age).on(:create, :update) }
|
22
|
-
it { is_expected.to validate_inclusion_of(:age).to_allow(23..42).on([
|
22
|
+
it { is_expected.to validate_inclusion_of(:age).to_allow(23..42).on(%i[create update]) }
|
23
23
|
it { is_expected.to validate_presence_of(:password).on(:create) }
|
24
|
+
it { is_expected.to validate_confirmation_of(:password).with_message('Password confirmation must match given password') }
|
24
25
|
it { is_expected.to validate_presence_of(:provider_uid).on(:create) }
|
25
|
-
it { is_expected.to validate_inclusion_of(:locale).to_allow([
|
26
|
+
it { is_expected.to validate_inclusion_of(:locale).to_allow(%i[en ru]) }
|
26
27
|
end
|
27
28
|
|
28
29
|
describe Profile do
|
29
30
|
it { is_expected.to validate_numericality_of(:age).greater_than(0) }
|
31
|
+
it { is_expected.not_to validate_numericality_of(:age).greater_than(0).only_integer(true) }
|
30
32
|
it { is_expected.to validate_acceptance_of(:terms_of_service) }
|
31
|
-
it { is_expected.to validate_length_of(:hobbies).with_minimum(1).with_message(
|
33
|
+
it { is_expected.to validate_length_of(:hobbies).with_minimum(1).with_message('requires at least one hobby') }
|
32
34
|
end
|
33
35
|
|
34
36
|
describe Article do
|
35
37
|
it { is_expected.to validate_length_of(:title).within(8..16) }
|
36
38
|
it { is_expected.not_to validate_length_of(:content).greater_than(200).less_than(16) }
|
37
39
|
it { is_expected.to validate_length_of(:content).greater_than(200) }
|
38
|
-
it { is_expected.to validate_inclusion_of(:status).to_allow([:pending]).on(
|
39
|
-
it { is_expected.to validate_inclusion_of(:status).to_allow([
|
40
|
+
it { is_expected.to validate_inclusion_of(:status).to_allow([:pending]).on(:create) }
|
41
|
+
it { is_expected.to validate_inclusion_of(:status).to_allow(%i[approved rejected]).on(:update) }
|
42
|
+
it { is_expected.to validate_absence_of(:deletion_date) } if Mongoid::Compatibility::Version.mongoid4_or_newer?
|
40
43
|
end
|
41
44
|
|
42
45
|
describe MovieArticle do
|
43
46
|
it { is_expected.to validate_numericality_of(:rating).greater_than(0) }
|
44
|
-
it { is_expected.to validate_numericality_of(:rating).to_allow(:
|
45
|
-
it { is_expected.to validate_numericality_of(:classification).to_allow(:
|
47
|
+
it { is_expected.to validate_numericality_of(:rating).to_allow(greater_than: 0).less_than_or_equal_to(5) }
|
48
|
+
it { is_expected.to validate_numericality_of(:classification).to_allow(even: true, only_integer: true, nil: false) }
|
46
49
|
end
|
47
50
|
|
48
51
|
describe Person do
|
49
52
|
it { is_expected.to custom_validate(:ssn).with_validator(SsnValidator) }
|
50
53
|
it { is_expected.not_to custom_validate(:name) }
|
51
54
|
end
|
55
|
+
|
56
|
+
describe Message do
|
57
|
+
it { is_expected.to validate_uniqueness_of(:identifier).with_message('uniqueness') }
|
58
|
+
it { is_expected.to validate_presence_of(:from).with_message('required') }
|
59
|
+
it { is_expected.to validate_format_of(:to).with_message('format') }
|
60
|
+
end
|
52
61
|
end
|
@@ -1,16 +1,16 @@
|
|
1
|
-
class SsnValidator <
|
2
|
-
|
1
|
+
class SsnValidator < ActiveModel::EachValidator
|
3
2
|
def validate_each(record, attribute, value)
|
4
3
|
unless valid_ssn?(record, attribute, value)
|
5
4
|
record.errors[attribute] << "#{value} is not a valid Social Security Number"
|
6
5
|
end
|
7
6
|
end
|
8
7
|
|
9
|
-
def self.kind
|
8
|
+
def self.kind
|
9
|
+
:custom
|
10
|
+
end
|
10
11
|
|
11
|
-
def valid_ssn?(
|
12
|
+
def valid_ssn?(_record, _attribute, _value)
|
12
13
|
# irrelevant here how validation is done
|
13
14
|
true
|
14
15
|
end
|
15
|
-
|
16
|
-
end
|
16
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid-rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Sagge
|
@@ -9,74 +9,143 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-06-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: activesupport
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 3.0.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: 3.0.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: mongoid
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '3.1'
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '3.1'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: mongoid-compatibility
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 0.5.1
|
49
|
+
type: :runtime
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 0.5.1
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: rspec-core
|
30
58
|
requirement: !ruby/object:Gem::Requirement
|
31
59
|
requirements:
|
32
60
|
- - "~>"
|
33
61
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
62
|
+
version: '3.3'
|
35
63
|
type: :runtime
|
36
64
|
prerelease: false
|
37
65
|
version_requirements: !ruby/object:Gem::Requirement
|
38
66
|
requirements:
|
39
67
|
- - "~>"
|
40
68
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
69
|
+
version: '3.3'
|
42
70
|
- !ruby/object:Gem::Dependency
|
43
|
-
name: rspec
|
71
|
+
name: rspec-expectations
|
44
72
|
requirement: !ruby/object:Gem::Requirement
|
45
73
|
requirements:
|
46
74
|
- - "~>"
|
47
75
|
- !ruby/object:Gem::Version
|
48
|
-
version: '3.
|
76
|
+
version: '3.3'
|
49
77
|
type: :runtime
|
50
78
|
prerelease: false
|
51
79
|
version_requirements: !ruby/object:Gem::Requirement
|
52
80
|
requirements:
|
53
81
|
- - "~>"
|
54
82
|
- !ruby/object:Gem::Version
|
55
|
-
version: '3.
|
83
|
+
version: '3.3'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: rspec-mocks
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - "~>"
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '3.3'
|
91
|
+
type: :runtime
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - "~>"
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '3.3'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: appraisal
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - "~>"
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '2.2'
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - "~>"
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '2.2'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: rake
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - "~>"
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '10.0'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - "~>"
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '10.0'
|
56
126
|
description: RSpec matches for Mongoid models, including association and validation
|
57
|
-
matchers
|
127
|
+
matchers.
|
58
128
|
email: evansagge@gmail.com contato@rodrigopinto.me
|
59
129
|
executables: []
|
60
130
|
extensions: []
|
61
131
|
extra_rdoc_files: []
|
62
132
|
files:
|
63
|
-
- ".bundle/config"
|
64
|
-
- ".document"
|
65
|
-
- ".gitignore"
|
66
|
-
- ".ruby-gemset"
|
67
|
-
- ".ruby-version"
|
68
|
-
- ".travis.yml"
|
69
|
-
- Gemfile
|
70
133
|
- LICENSE
|
71
134
|
- README.md
|
72
135
|
- Rakefile
|
73
136
|
- lib/matchers/accept_nested_attributes.rb
|
74
137
|
- lib/matchers/allow_mass_assignment.rb
|
75
138
|
- lib/matchers/associations.rb
|
76
|
-
- lib/matchers/
|
77
|
-
- lib/matchers/
|
78
|
-
- lib/matchers/
|
139
|
+
- lib/matchers/be_dynamic_document.rb
|
140
|
+
- lib/matchers/be_mongoid_document.rb
|
141
|
+
- lib/matchers/be_stored_in.rb
|
142
|
+
- lib/matchers/have_field.rb
|
143
|
+
- lib/matchers/have_timestamps.rb
|
144
|
+
- lib/matchers/indexes/have_index_for.rb
|
145
|
+
- lib/matchers/indexes/v3/have_index_for.rb
|
146
|
+
- lib/matchers/indexes/v4/have_index_for.rb
|
79
147
|
- lib/matchers/validations.rb
|
148
|
+
- lib/matchers/validations/absence_of.rb
|
80
149
|
- lib/matchers/validations/acceptance_of.rb
|
81
150
|
- lib/matchers/validations/associated.rb
|
82
151
|
- lib/matchers/validations/confirmation_of.rb
|
@@ -88,13 +157,13 @@ files:
|
|
88
157
|
- lib/matchers/validations/numericality_of.rb
|
89
158
|
- lib/matchers/validations/presence_of.rb
|
90
159
|
- lib/matchers/validations/uniqueness_of.rb
|
91
|
-
- lib/matchers/validations/with_message.rb
|
92
160
|
- lib/mongoid-rspec.rb
|
93
|
-
- lib/mongoid
|
94
|
-
- mongoid
|
161
|
+
- lib/mongoid/rspec.rb
|
162
|
+
- lib/mongoid/rspec/version.rb
|
95
163
|
- spec/models/article.rb
|
96
164
|
- spec/models/comment.rb
|
97
165
|
- spec/models/log.rb
|
166
|
+
- spec/models/message.rb
|
98
167
|
- spec/models/movie_article.rb
|
99
168
|
- spec/models/permalink.rb
|
100
169
|
- spec/models/person.rb
|
@@ -105,13 +174,17 @@ files:
|
|
105
174
|
- spec/spec_helper.rb
|
106
175
|
- spec/unit/accept_nested_attributes_spec.rb
|
107
176
|
- spec/unit/associations_spec.rb
|
108
|
-
- spec/unit/
|
177
|
+
- spec/unit/be_dynamic_document_spec.rb
|
178
|
+
- spec/unit/be_mongoid_document_spec.rb
|
179
|
+
- spec/unit/be_stored_in.rb
|
109
180
|
- spec/unit/document_spec.rb
|
110
|
-
- spec/unit/
|
181
|
+
- spec/unit/have_index_for_spec.rb
|
182
|
+
- spec/unit/have_timestamps_spec.rb
|
111
183
|
- spec/unit/validations_spec.rb
|
112
184
|
- spec/validators/ssn_validator.rb
|
113
185
|
homepage: http://github.com/mongoid-rspec/mongoid-rspec
|
114
|
-
licenses:
|
186
|
+
licenses:
|
187
|
+
- MIT
|
115
188
|
metadata: {}
|
116
189
|
post_install_message:
|
117
190
|
rdoc_options: []
|
@@ -121,34 +194,37 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
121
194
|
requirements:
|
122
195
|
- - ">="
|
123
196
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
197
|
+
version: '2.2'
|
125
198
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
126
199
|
requirements:
|
127
200
|
- - ">="
|
128
201
|
- !ruby/object:Gem::Version
|
129
|
-
version:
|
202
|
+
version: 1.3.6
|
130
203
|
requirements: []
|
131
|
-
|
132
|
-
rubygems_version: 2.4.5
|
204
|
+
rubygems_version: 3.1.3
|
133
205
|
signing_key:
|
134
206
|
specification_version: 4
|
135
207
|
summary: RSpec matchers for Mongoid
|
136
208
|
test_files:
|
209
|
+
- spec/spec_helper.rb
|
210
|
+
- spec/unit/associations_spec.rb
|
211
|
+
- spec/unit/be_dynamic_document_spec.rb
|
212
|
+
- spec/unit/validations_spec.rb
|
213
|
+
- spec/unit/be_stored_in.rb
|
214
|
+
- spec/unit/have_index_for_spec.rb
|
215
|
+
- spec/unit/accept_nested_attributes_spec.rb
|
216
|
+
- spec/unit/document_spec.rb
|
217
|
+
- spec/unit/be_mongoid_document_spec.rb
|
218
|
+
- spec/unit/have_timestamps_spec.rb
|
137
219
|
- spec/models/article.rb
|
138
|
-
- spec/models/comment.rb
|
139
|
-
- spec/models/log.rb
|
140
220
|
- spec/models/movie_article.rb
|
141
|
-
- spec/models/permalink.rb
|
142
|
-
- spec/models/person.rb
|
143
|
-
- spec/models/profile.rb
|
144
221
|
- spec/models/record.rb
|
145
222
|
- spec/models/site.rb
|
223
|
+
- spec/models/message.rb
|
224
|
+
- spec/models/permalink.rb
|
225
|
+
- spec/models/profile.rb
|
226
|
+
- spec/models/comment.rb
|
227
|
+
- spec/models/person.rb
|
228
|
+
- spec/models/log.rb
|
146
229
|
- spec/models/user.rb
|
147
|
-
- spec/spec_helper.rb
|
148
|
-
- spec/unit/accept_nested_attributes_spec.rb
|
149
|
-
- spec/unit/associations_spec.rb
|
150
|
-
- spec/unit/collections_spec.rb
|
151
|
-
- spec/unit/document_spec.rb
|
152
|
-
- spec/unit/indexes_spec.rb
|
153
|
-
- spec/unit/validations_spec.rb
|
154
230
|
- spec/validators/ssn_validator.rb
|