Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix upgrading to ROM 4.x #25

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
language: ruby

dist: trusty
sudo: required
sudo: false

cache: bundler

services:
- mongodb
bundler_args: --without yard guard benchmarks tools
after_success:
- '[ -d coverage ] && bundle exec codeclimate-test-reporter'
script: "bundle exec rake ci"

rvm:
- 2.2.6
- 2.3.3
- 2.4.1
- rbx-3
- jruby
- 2.5.0
- jruby-9.1.13.0

bundler_args: --without tools

env:
global:
- JRUBY_OPTS='--dev -J-Xmx1024M'
- COVERAGE='true'
matrix:
allow_failures:
- rvm: rbx-3

before_install:
# NOTE: https://github.com/travis-ci/travis-ci/issues/8978
- gem update --system

after_success:
- '[ -d coverage ] && bundle exec codeclimate-test-reporter'

notifications:
webhooks:
urls:
Expand Down
2 changes: 1 addition & 1 deletion lib/rom/mongo/struct.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module ROM
module Mongo
class Struct < ROM::Struct
constructor_type :symbolized
constructor_type :permissive
end
end
end
8 changes: 2 additions & 6 deletions spec/integration/gateway_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@
it 'inserts a document into collection' do
id = BSON::ObjectId.new

result = commands.try do
commands.create.call(_id: id, name: 'joe', email: '[email protected]')
end
result = commands.create.call(_id: id, name: 'joe', email: '[email protected]')

expect(result)
.to match_array([{ _id: id, name: 'joe', email: '[email protected]' }])
Expand All @@ -71,9 +69,7 @@
it 'updates a document in the collection' do
jane = users.by_name('Jane').one!

result = commands.try do
commands.update.by_name('Jane').call(email: '[email protected]')
end
result = commands.update.by_name('Jane').call(email: '[email protected]')

expect(result).to match_array(
[{ '_id' => BSON::ObjectId.from_string(jane._id),
Expand Down