rom 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/spec/spec_helper.rb CHANGED
@@ -9,11 +9,13 @@ if RUBY_ENGINE == "rbx"
9
9
  CodeClimate::TestReporter.start
10
10
  end
11
11
 
12
+ require 'virtus'
12
13
  require 'rom'
13
14
  require 'rom/adapter/memory'
14
15
 
15
16
  root = Pathname(__FILE__).dirname
16
17
 
18
+ Dir[root.join('support/*.rb').to_s].each { |f| require f }
17
19
  Dir[root.join('shared/*.rb').to_s].each { |f| require f }
18
20
 
19
21
  RSpec.configure do |config|
@@ -0,0 +1,7 @@
1
+ module Mutant
2
+ class Subject
3
+ def tests
4
+ config.integration.all_tests
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ describe ROM::Env do
4
+ include_context 'users and tasks'
5
+
6
+ before { setup.relation(:users) }
7
+
8
+ it 'exposes repositories on method-missing' do
9
+ expect(rom.memory).to be(rom.repositories[:memory])
10
+ end
11
+
12
+ it 'responds to methods corresponding to repository names' do
13
+ expect(rom).to respond_to(:memory)
14
+ end
15
+
16
+ it 'raises exception when unknown repository is referenced' do
17
+ expect { rom.not_here }.to raise_error(NoMethodError)
18
+ end
19
+ end
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ describe ROM::Repository do
4
+ include_context 'users and tasks'
5
+
6
+ subject(:repository) { rom.memory }
7
+
8
+ before { setup.relation(:users) }
9
+
10
+ it 'exposes datasets on method-missing' do
11
+ expect(repository.users).to be(rom.memory[:users])
12
+ end
13
+
14
+ it 'responds to methods corresponding to dataset names' do
15
+ expect(repository).to respond_to(:users)
16
+ end
17
+
18
+ it 'raises exception when unknown dataset is referenced' do
19
+ expect { repository.not_here }.to raise_error(NoMethodError)
20
+ end
21
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Solnica
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-11-25 00:00:00.000000000 Z
12
+ date: 2014-12-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: addressable
@@ -174,12 +174,22 @@ files:
174
174
  - lib/rom.rb
175
175
  - lib/rom/adapter.rb
176
176
  - lib/rom/adapter/memory.rb
177
+ - lib/rom/adapter/memory/commands.rb
178
+ - lib/rom/adapter/memory/dataset.rb
179
+ - lib/rom/adapter/memory/storage.rb
177
180
  - lib/rom/boot.rb
178
181
  - lib/rom/boot/base_relation_dsl.rb
182
+ - lib/rom/boot/command_dsl.rb
179
183
  - lib/rom/boot/dsl.rb
180
184
  - lib/rom/boot/mapper_dsl.rb
181
185
  - lib/rom/boot/relation_dsl.rb
182
186
  - lib/rom/boot/schema_dsl.rb
187
+ - lib/rom/command_registry.rb
188
+ - lib/rom/commands.rb
189
+ - lib/rom/commands/create.rb
190
+ - lib/rom/commands/delete.rb
191
+ - lib/rom/commands/update.rb
192
+ - lib/rom/commands/with_options.rb
183
193
  - lib/rom/env.rb
184
194
  - lib/rom/header.rb
185
195
  - lib/rom/mapper.rb
@@ -198,6 +208,12 @@ files:
198
208
  - lib/rom/version.rb
199
209
  - rom.gemspec
200
210
  - spec/integration/adapters/extending_relations_spec.rb
211
+ - spec/integration/adapters/setting_logger_spec.rb
212
+ - spec/integration/commands/create_spec.rb
213
+ - spec/integration/commands/delete_spec.rb
214
+ - spec/integration/commands/error_handling_spec.rb
215
+ - spec/integration/commands/try_spec.rb
216
+ - spec/integration/commands/update_spec.rb
201
217
  - spec/integration/mappers/definition_dsl_spec.rb
202
218
  - spec/integration/mappers/prefixing_attributes_spec.rb
203
219
  - spec/integration/mappers/renaming_attributes_spec.rb
@@ -210,12 +226,15 @@ files:
210
226
  - spec/integration/setup_spec.rb
211
227
  - spec/shared/users_and_tasks.rb
212
228
  - spec/spec_helper.rb
229
+ - spec/support/mutant.rb
213
230
  - spec/unit/rom/adapter_spec.rb
231
+ - spec/unit/rom/env_spec.rb
214
232
  - spec/unit/rom/header_spec.rb
215
233
  - spec/unit/rom/mapper_spec.rb
216
234
  - spec/unit/rom/ra/operation/group_spec.rb
217
235
  - spec/unit/rom/ra/operation/wrap_spec.rb
218
236
  - spec/unit/rom/relation_spec.rb
237
+ - spec/unit/rom/repository_spec.rb
219
238
  homepage: http://rom-rb.org
220
239
  licenses:
221
240
  - MIT
@@ -241,3 +260,4 @@ signing_key:
241
260
  specification_version: 4
242
261
  summary: Ruby Object Mapper
243
262
  test_files: []
263
+ has_rdoc: