mongoid-rspec 1.9.0 → 1.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MzcxM2M0YmU2MzM0MmRiMDY1MmZjZTE1NDkyN2ZlYWJlMDU3Yjk4NA==
5
+ data.tar.gz: !binary |-
6
+ ZThhMDdkZjY0MzcwNTJjMmM2NzcwOTgxMmM0ZjA1MjE5MDQ0MjE0MA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ OTY3MTg0NTgzMjQ3NTE2NTRiMzIyNWNhYjEzNWEzMDFhMGEyZDNkYjJiMGUx
10
+ ZDY5MTBmZTI3NTNhZGI1OGNkOTQwYzg1ODNkYmRiNDhkMWZlOTQ5NDE3N2E5
11
+ NzdlMWU4YjI3ZGExMjJkNDMzMGEzODcxYjczMGEzNmNlYjZmMmQ=
12
+ data.tar.gz: !binary |-
13
+ NGJiNTZjZGJmZmI4Njg4OTFlZDJkMWVmODRmMDI1NjUxMGZmYTE3ODM3YjE3
14
+ MGI1Y2U3MzA4YjA4MDZlMTg5OGQ1NjVjMThhNWJlY2NlNjkyYjE4NDExNzQ4
15
+ ODc0MWMxNmI3Yzc3NTc2MTEzNzY3YWM0YWEyN2E1MTBmZTI3ODA=
data/README.md CHANGED
@@ -18,8 +18,8 @@ Add to your Gemfile
18
18
  Drop in existing or dedicated support file in spec/support (spec/support/mongoid.rb)
19
19
 
20
20
  ```ruby
21
- RSpec.configure do |configuration|
22
- configuration.include Mongoid::Matchers
21
+ RSpec.configure do |config|
22
+ config.include Mongoid::Matchers, type: :model
23
23
  end
24
24
  ```
25
25
 
@@ -12,16 +12,11 @@ module Mongoid
12
12
  EMBEDS_ONE = Mongoid::Relations::Embedded::One
13
13
  EMBEDDED_IN = Mongoid::Relations::Embedded::In
14
14
 
15
-
16
15
  class HaveAssociationMatcher
17
16
  def initialize(name, association_type)
18
17
  @association = {}
19
18
  @association[:name] = name.to_s
20
19
  @association[:type] = association_type
21
- # begin
22
- # @association[:class] = name.to_s.classify.constantize
23
- # rescue
24
- # end
25
20
  @expectation_message = "#{type_description} #{@association[:name].inspect}"
26
21
  @expectation_message << " of type #{@association[:class].inspect}" unless @association[:class].nil?
27
22
  end
@@ -278,10 +273,9 @@ module Mongoid
278
273
  end
279
274
 
280
275
  private
281
-
282
- def order_way(operator)
283
- [nil, "ascending", "descending"][operator]
284
- end
276
+ def order_way(operator)
277
+ [nil, "ascending", "descending"][operator]
278
+ end
285
279
  end
286
280
 
287
281
  def embed_one(association_name)
data/lib/mongoid-rspec.rb CHANGED
@@ -1,7 +1,9 @@
1
1
  $LOAD_PATH.unshift(File.dirname(__FILE__))
2
2
 
3
3
  require 'mongoid'
4
- require 'rspec'
4
+ require 'rspec/core'
5
+ require 'rspec/expectations'
6
+ require 'rspec/mocks'
5
7
  require "active_model"
6
8
  require 'matchers/document'
7
9
  require 'matchers/associations'
@@ -1,5 +1,5 @@
1
1
  module Mongoid
2
2
  module Rspec
3
- VERSION = "1.9.0"
3
+ VERSION = "1.10.0"
4
4
  end
5
5
  end
@@ -8,7 +8,7 @@ describe "Associations" do
8
8
 
9
9
  it { should have_many(:comments).with_dependent(:destroy).with_autosave }
10
10
 
11
- it { should embed_one :profile }
11
+ it { should embed_one(:profile) }
12
12
 
13
13
  it { should have_and_belong_to_many(:children).of_type(User) }
14
14
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
5
- prerelease:
4
+ version: 1.10.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Evan Sagge
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-08-11 00:00:00.000000000 Z
11
+ date: 2013-12-07 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rake
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ! '>='
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ! '>='
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: mongoid
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rspec
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ! '>='
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ! '>='
60
53
  - !ruby/object:Gem::Version
@@ -118,33 +111,26 @@ files:
118
111
  - spec/validators/ssn_validator.rb
119
112
  homepage: http://github.com/evansagge/mongoid-rspec
120
113
  licenses: []
114
+ metadata: {}
121
115
  post_install_message:
122
116
  rdoc_options: []
123
117
  require_paths:
124
118
  - lib
125
119
  required_ruby_version: !ruby/object:Gem::Requirement
126
- none: false
127
120
  requirements:
128
121
  - - ! '>='
129
122
  - !ruby/object:Gem::Version
130
123
  version: '0'
131
- segments:
132
- - 0
133
- hash: 2533253103994848490
134
124
  required_rubygems_version: !ruby/object:Gem::Requirement
135
- none: false
136
125
  requirements:
137
126
  - - ! '>='
138
127
  - !ruby/object:Gem::Version
139
128
  version: '0'
140
- segments:
141
- - 0
142
- hash: 2533253103994848490
143
129
  requirements: []
144
130
  rubyforge_project: mongoid-rspec
145
- rubygems_version: 1.8.25
131
+ rubygems_version: 2.0.8
146
132
  signing_key:
147
- specification_version: 3
133
+ specification_version: 4
148
134
  summary: RSpec matchers for Mongoid
149
135
  test_files:
150
136
  - spec/models/article.rb