Skip to content

Commit

Permalink
Merge pull request #3 from hmadison/hm/rom-2.0
Browse files Browse the repository at this point in the history
Update to ROM 2.0
  • Loading branch information
solnic committed Oct 11, 2016
2 parents 0c0936b + def4644 commit 0dae446
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 20 deletions.
12 changes: 7 additions & 5 deletions .travis.yml
Expand Up @@ -4,15 +4,17 @@ env:
- CODECLIMATE_REPO_TOKEN=ef69eb6a9e19987527e5010a02bbf71cd4ddc8a5137ba308f299817f56d06e7f
script: "bundle exec rake spec"
rvm:
- 2.0
- 2.1
- 2.2
- rbx-2
- jruby
- 2.1.9
- 2.2.5
- 2.3.1
- ruby-2.4.0-preview2
- rbx
- jruby-9.1.5.0
- ruby-head
matrix:
allow_failures:
- rvm: ruby-head
- rvm: rbx
notifications:
webhooks:
urls:
Expand Down
2 changes: 1 addition & 1 deletion rom-json.gemspec
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']

spec.add_runtime_dependency "rom", "~> 0.9.0.rc1"
spec.add_runtime_dependency "rom", "~> 2.0"

spec.add_development_dependency 'bundler'
spec.add_development_dependency 'rake'
Expand Down
19 changes: 8 additions & 11 deletions spec/integration/adapter_spec.rb
Expand Up @@ -3,15 +3,13 @@
require 'rom/lint/spec'

describe 'JSON adapter' do
subject(:rom) { setup.finalize }

let(:root) { Pathname(__FILE__).dirname.join('..') }

let(:path) { "#{root}/fixtures/test_db.json" }
let(:setup) { ROM.setup(:json, path) }

before do
setup.relation(:users) do
subject(:rom) do
ROM.container(:json, path) do |setup|
setup.relation(:users) do
def by_name(name)
restrict(name: name)
end
Expand All @@ -31,6 +29,7 @@ def by_name(name)
end
end
end
end
end

describe 'env#relation' do
Expand All @@ -48,12 +47,10 @@ def by_name(name)

describe 'multi-file setup' do
it 'uses one-file-per-relation' do
setup = ROM.setup(:json, "#{root}/fixtures/db")

setup.relation(:users)
setup.relation(:tasks)

rom = setup.finalize
rom = ROM.container(:json, "#{root}/fixtures/db") do |setup|
setup.relation(:users)
setup.relation(:tasks)
end

expect(rom.relation(:users)).to match_array([
{ name: 'Jane', email: 'jane@doe.org' }
Expand Down
8 changes: 5 additions & 3 deletions spec/spec_helper.rb
@@ -1,13 +1,15 @@
# encoding: utf-8

require 'bundler'
Bundler.setup

require 'rom-json'

if RUBY_ENGINE == 'rbx'
require "codeclimate-test-reporter"
CodeClimate::TestReporter.start
end

require 'rom-json'
ROM.use :auto_registration

begin
require 'byebug'
rescue LoadError
Expand Down

0 comments on commit 0dae446

Please sign in to comment.