Skip to content

Commit 0cbc328

Browse files
author
Daniel P. Shannon
committed
Add tests for Mongoid 6.
1 parent 5af992e commit 0cbc328

File tree

10 files changed

+241
-14
lines changed

10 files changed

+241
-14
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services: mongodb
22
language: ruby
33
before_install: gem install bundler -v='1.11.2'
4-
script: "bundle exec rake spec"
4+
script: "bundle exec rake spec:all"
55
rvm:
66
- 1.9.3
77
- 2.0.0
@@ -13,4 +13,4 @@ notifications:
1313
email: false
1414
addons:
1515
code_climate:
16-
repo_token: f506e465f1ed0571aeaa5e1cb9c14214c9f7567a92d1af70903f3d0bc8015ed6
16+
repo_token: f506e465f1ed0571aeaa5e1cb9c14214c9f7567a92d1af70903f3d0bc8015ed6

Rakefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ end
1010
task :default => "spec:all"
1111

1212
namespace :spec do
13-
%w(mongoid_4 mongoid_5).each do |gemfile|
13+
%w(mongoid_4 mongoid_5 mongoid_6).each do |gemfile|
1414
desc "Run Tests against #{gemfile}"
1515
task gemfile do
1616
sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle --quiet"
@@ -20,9 +20,9 @@ namespace :spec do
2020

2121
desc "Run Tests against rails versions"
2222
task :all do
23-
%w(mongoid_4 mongoid_5).each do |gemfile|
23+
%w(mongoid_4 mongoid_5 mongoid_6).each do |gemfile|
2424
sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle --quiet"
2525
sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle exec rake spec"
2626
end
2727
end
28-
end
28+
end

gemfiles/mongoid_4.gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
source 'https://rubygems.org'
22

33
gem 'mongoid', '~> 4.0.2'
4+
gem 'rails-observers', '~> 0.1.2'
45
gem 'rake', '~> 10.4.2'
56
gem 'rspec', '~> 3.1.0'
67
gem 'guard-rspec', '~> 4.6.4'
@@ -10,4 +11,4 @@ gem 'coveralls', '~> 0.8.2', require: false
1011
gem 'codeclimate-test-reporter'
1112
gem 'railties'
1213

13-
gemspec :path => '../'
14+
gemspec :path => '../'

gemfiles/mongoid_4.gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
PATH
22
remote: ../
33
specs:
4-
mongoid-observers (0.1.1)
4+
mongoid-observers (0.2.0)
55
mongoid (>= 4.0.0)
6-
rails-observers (~> 0.1.2)
76

87
GEM
98
remote: https://rubygems.org/
@@ -180,10 +179,11 @@ DEPENDENCIES
180179
mongoid (~> 4.0.2)
181180
mongoid-observers!
182181
pry (~> 0.9.12.6)
182+
rails-observers (~> 0.1.2)
183183
railties
184184
rake (~> 10.4.2)
185185
rspec (~> 3.1.0)
186186
simplecov (~> 0.10.0)
187187

188188
BUNDLED WITH
189-
1.11.2
189+
1.12.1

gemfiles/mongoid_5.gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
source 'https://rubygems.org'
22

33
gem 'mongoid', '~> 5.1.2'
4+
gem 'rails-observers', '~> 0.1.2'
45
gem 'rake', '~> 10.4.2'
56
gem 'rspec', '~> 3.1.0'
67
gem 'guard-rspec', '~> 4.6.4'
@@ -10,4 +11,4 @@ gem 'coveralls', '~> 0.8.2', require: false
1011
gem 'codeclimate-test-reporter'
1112
gem 'railties'
1213

13-
gemspec :path => '../'
14+
gemspec :path => '../'

gemfiles/mongoid_5.gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
PATH
22
remote: ../
33
specs:
4-
mongoid-observers (0.1.1)
4+
mongoid-observers (0.2.0)
55
mongoid (>= 4.0.0)
6-
rails-observers (~> 0.1.2)
76

87
GEM
98
remote: https://rubygems.org/
@@ -176,10 +175,11 @@ DEPENDENCIES
176175
mongoid (~> 5.1.2)
177176
mongoid-observers!
178177
pry (~> 0.9.12.6)
178+
rails-observers (~> 0.1.2)
179179
railties
180180
rake (~> 10.4.2)
181181
rspec (~> 3.1.0)
182182
simplecov (~> 0.10.0)
183183

184184
BUNDLED WITH
185-
1.11.2
185+
1.12.1

gemfiles/mongoid_6.gemfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'actionpack', '~> 5.0.0.rc1'
4+
gem 'mongoid', github: 'mongodb/mongoid'
5+
gem 'rails-observers', github: 'rails/rails-observers'
6+
gem 'rake', '~> 10.4.2'
7+
gem 'rspec', '~> 3.5.0.beta.2'
8+
gem 'rspec-core', '~> 3.5.0.beta.3'
9+
gem 'rspec-rails', '~> 3.5.0.beta.2'
10+
gem 'guard-rspec', '~> 4.6.4'
11+
gem 'pry', '~> 0.9.12.6'
12+
gem 'simplecov', '~> 0.10.0'
13+
gem 'coveralls', '~> 0.8.2', require: false
14+
gem 'codeclimate-test-reporter'
15+
gem 'railties', '~> 5.0.0.rc1'
16+
17+
gemspec :path => '../'

gemfiles/mongoid_6.gemfile.lock

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
GIT
2+
remote: git://github.com/mongodb/mongoid.git
3+
revision: 7c2ff52a0c5292b8e6bf3a9a29bbb19abae3dd5f
4+
specs:
5+
mongoid (6.0.0)
6+
activemodel (= 5.0.0.rc1)
7+
mongo (~> 2.2)
8+
tzinfo (>= 0.3.37)
9+
10+
GIT
11+
remote: git://github.com/rails/rails-observers.git
12+
revision: 2e83e3bf13dd4d963ed70bf4766f233f993b3e44
13+
specs:
14+
rails-observers (0.1.3.alpha)
15+
activemodel (>= 4.0, < 5.1)
16+
17+
PATH
18+
remote: ../
19+
specs:
20+
mongoid-observers (0.2.0)
21+
mongoid (>= 4.0.0)
22+
23+
GEM
24+
remote: https://rubygems.org/
25+
specs:
26+
actionpack (5.0.0.rc1)
27+
actionview (= 5.0.0.rc1)
28+
activesupport (= 5.0.0.rc1)
29+
rack (~> 2.x)
30+
rack-test (~> 0.6.3)
31+
rails-dom-testing (~> 1.0, >= 1.0.5)
32+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
33+
actionview (5.0.0.rc1)
34+
activesupport (= 5.0.0.rc1)
35+
builder (~> 3.1)
36+
erubis (~> 2.7.0)
37+
rails-dom-testing (~> 1.0, >= 1.0.5)
38+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
39+
activemodel (5.0.0.rc1)
40+
activesupport (= 5.0.0.rc1)
41+
activesupport (5.0.0.rc1)
42+
concurrent-ruby (~> 1.0, >= 1.0.2)
43+
i18n (~> 0.7)
44+
minitest (~> 5.1)
45+
tzinfo (~> 1.1)
46+
ammeter (1.1.3)
47+
activesupport (>= 3.0)
48+
railties (>= 3.0)
49+
rspec-rails (>= 2.2)
50+
bson (4.1.1)
51+
builder (3.2.2)
52+
codeclimate-test-reporter (0.5.0)
53+
simplecov (>= 0.7.1, < 1.0.0)
54+
coderay (1.1.1)
55+
concurrent-ruby (1.0.2)
56+
coveralls (0.8.9)
57+
json (~> 1.8)
58+
rest-client (>= 1.6.8, < 2)
59+
simplecov (~> 0.10.0)
60+
term-ansicolor (~> 1.3)
61+
thor (~> 0.19.1)
62+
tins (~> 1.6.0)
63+
diff-lcs (1.2.5)
64+
docile (1.1.5)
65+
domain_name (0.5.20160310)
66+
unf (>= 0.0.5, < 1.0.0)
67+
erubis (2.7.0)
68+
ffi (1.9.10)
69+
formatador (0.2.5)
70+
guard (2.14.0)
71+
formatador (>= 0.2.4)
72+
listen (>= 2.7, < 4.0)
73+
lumberjack (~> 1.0)
74+
nenv (~> 0.1)
75+
notiffany (~> 0.0)
76+
pry (>= 0.9.12)
77+
shellany (~> 0.0)
78+
thor (>= 0.18.1)
79+
guard-compat (1.2.1)
80+
guard-rspec (4.6.5)
81+
guard (~> 2.1)
82+
guard-compat (~> 1.1)
83+
rspec (>= 2.99.0, < 4.0)
84+
http-cookie (1.0.2)
85+
domain_name (~> 0.5)
86+
i18n (0.7.0)
87+
json (1.8.3)
88+
listen (3.1.5)
89+
rb-fsevent (~> 0.9, >= 0.9.4)
90+
rb-inotify (~> 0.9, >= 0.9.7)
91+
ruby_dep (~> 1.2)
92+
loofah (2.0.3)
93+
nokogiri (>= 1.5.9)
94+
lumberjack (1.0.10)
95+
method_source (0.8.2)
96+
mime-types (2.99.1)
97+
mini_portile2 (2.0.0)
98+
minitest (5.9.0)
99+
mongo (2.2.5)
100+
bson (~> 4.0)
101+
nenv (0.3.0)
102+
netrc (0.11.0)
103+
nokogiri (1.6.7.2)
104+
mini_portile2 (~> 2.0.0.rc2)
105+
notiffany (0.1.0)
106+
nenv (~> 0.1)
107+
shellany (~> 0.0)
108+
pry (0.9.12.6)
109+
coderay (~> 1.0)
110+
method_source (~> 0.8)
111+
slop (~> 3.4)
112+
rack (2.0.0.rc1)
113+
json
114+
rack-test (0.6.3)
115+
rack (>= 1.0)
116+
rails-deprecated_sanitizer (1.0.3)
117+
activesupport (>= 4.2.0.alpha)
118+
rails-dom-testing (1.0.7)
119+
activesupport (>= 4.2.0.beta, < 5.0)
120+
nokogiri (~> 1.6.0)
121+
rails-deprecated_sanitizer (>= 1.0.1)
122+
rails-html-sanitizer (1.0.3)
123+
loofah (~> 2.0)
124+
railties (5.0.0.rc1)
125+
actionpack (= 5.0.0.rc1)
126+
activesupport (= 5.0.0.rc1)
127+
method_source
128+
rake (>= 0.8.7)
129+
thor (>= 0.18.1, < 2.0)
130+
rake (10.4.2)
131+
rb-fsevent (0.9.7)
132+
rb-inotify (0.9.7)
133+
ffi (>= 0.5.0)
134+
rest-client (1.8.0)
135+
http-cookie (>= 1.0.2, < 2.0)
136+
mime-types (>= 1.16, < 3.0)
137+
netrc (~> 0.7)
138+
rspec (3.5.0.beta3)
139+
rspec-core (= 3.5.0.beta3)
140+
rspec-expectations (= 3.5.0.beta3)
141+
rspec-mocks (= 3.5.0.beta3)
142+
rspec-core (3.5.0.beta3)
143+
rspec-support (= 3.5.0.beta3)
144+
rspec-expectations (3.5.0.beta3)
145+
diff-lcs (>= 1.2.0, < 2.0)
146+
rspec-support (= 3.5.0.beta3)
147+
rspec-mocks (3.5.0.beta3)
148+
diff-lcs (>= 1.2.0, < 2.0)
149+
rspec-support (= 3.5.0.beta3)
150+
rspec-rails (3.5.0.beta3)
151+
actionpack (>= 3.0)
152+
activesupport (>= 3.0)
153+
railties (>= 3.0)
154+
rspec-core (= 3.5.0.beta3)
155+
rspec-expectations (= 3.5.0.beta3)
156+
rspec-mocks (= 3.5.0.beta3)
157+
rspec-support (= 3.5.0.beta3)
158+
rspec-support (3.5.0.beta3)
159+
ruby_dep (1.3.1)
160+
shellany (0.0.1)
161+
simplecov (0.10.0)
162+
docile (~> 1.1.0)
163+
json (~> 1.8)
164+
simplecov-html (~> 0.10.0)
165+
simplecov-html (0.10.0)
166+
slop (3.6.0)
167+
term-ansicolor (1.3.2)
168+
tins (~> 1.0)
169+
thor (0.19.1)
170+
thread_safe (0.3.5)
171+
tins (1.6.0)
172+
tzinfo (1.2.2)
173+
thread_safe (~> 0.1)
174+
unf (0.1.4)
175+
unf_ext
176+
unf_ext (0.0.7.2)
177+
178+
PLATFORMS
179+
ruby
180+
181+
DEPENDENCIES
182+
actionpack (~> 5.0.0.rc1)
183+
ammeter (~> 1.1.2)
184+
bundler (~> 1.11)
185+
codeclimate-test-reporter
186+
coveralls (~> 0.8.2)
187+
guard-rspec (~> 4.6.4)
188+
mongoid!
189+
mongoid-observers!
190+
pry (~> 0.9.12.6)
191+
rails-observers!
192+
railties (~> 5.0.0.rc1)
193+
rake (~> 10.4.2)
194+
rspec (~> 3.5.0.beta.2)
195+
rspec-core (~> 3.5.0.beta.3)
196+
rspec-rails (~> 3.5.0.beta.2)
197+
simplecov (~> 0.10.0)
198+
199+
BUNDLED WITH
200+
1.12.1

spec/config/mongoid_6.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
test:
2+
clients:
3+
default:
4+
database: mongoid_observers_test
5+
hosts:
6+
- localhost:27017

spec/spec_helper.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
Mongoid.load! File.dirname(__FILE__) + "/config/mongoid_4.yml", :test
2828
elsif Mongoid::VERSION.start_with?('5.')
2929
Mongoid.load! File.dirname(__FILE__) + "/config/mongoid_5.yml", :test
30+
elsif Mongoid::VERSION.start_with?('6.')
31+
Mongoid.load! File.dirname(__FILE__) + "/config/mongoid_6.yml", :test
3032
end
3133

3234
# Autoload every model for the test suite that sits in spec/app/models.
@@ -42,4 +44,4 @@
4244
config.before(:each) do
4345
Mongoid.purge!
4446
end
45-
end
47+
end

0 commit comments

Comments
 (0)