rom-http 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +16 -0
- data/.rspec +3 -0
- data/.rubocop.yml +19 -0
- data/.rubocop_todo.yml +6 -0
- data/.travis.yml +28 -0
- data/Gemfile +21 -0
- data/LICENSE.txt +22 -0
- data/README.md +58 -0
- data/Rakefile +24 -0
- data/lib/rom-http.rb +1 -0
- data/lib/rom/http.rb +8 -0
- data/lib/rom/http/commands.rb +4 -0
- data/lib/rom/http/commands/create.rb +17 -0
- data/lib/rom/http/commands/delete.rb +17 -0
- data/lib/rom/http/commands/update.rb +21 -0
- data/lib/rom/http/dataset.rb +114 -0
- data/lib/rom/http/error.rb +17 -0
- data/lib/rom/http/gateway.rb +31 -0
- data/lib/rom/http/relation.rb +25 -0
- data/lib/rom/http/version.rb +5 -0
- data/rakelib/rubocop.rake +18 -0
- data/rom-http.gemspec +28 -0
- data/spec/integration/abstract/commands/create_spec.rb +126 -0
- data/spec/integration/abstract/commands/delete_spec.rb +61 -0
- data/spec/integration/abstract/commands/update_spec.rb +126 -0
- data/spec/integration/abstract/relation_spec.rb +64 -0
- data/spec/shared/command_behaviour.rb +18 -0
- data/spec/shared/setup.rb +14 -0
- data/spec/shared/users_and_tasks.rb +10 -0
- data/spec/spec_helper.rb +11 -0
- data/spec/support/mutant.rb +10 -0
- data/spec/unit/rom/http/commands/create_spec.rb +22 -0
- data/spec/unit/rom/http/commands/delete_spec.rb +22 -0
- data/spec/unit/rom/http/commands/update_spec.rb +22 -0
- data/spec/unit/rom/http/dataset_spec.rb +472 -0
- data/spec/unit/rom/http/gateway_spec.rb +37 -0
- metadata +186 -0
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'rom/lint/spec'
|
2
|
+
|
3
|
+
RSpec.describe ROM::HTTP::Gateway do
|
4
|
+
include_context 'users and tasks'
|
5
|
+
|
6
|
+
let(:gateway) { rom.gateways[:default] }
|
7
|
+
|
8
|
+
it_behaves_like 'a rom gateway' do
|
9
|
+
let(:identifier) { :http }
|
10
|
+
let(:gateway) { ROM::HTTP::Gateway }
|
11
|
+
let(:options) do
|
12
|
+
{
|
13
|
+
uri: 'http://localhost:3000',
|
14
|
+
request_handler: request_handler,
|
15
|
+
response_handler: response_handler
|
16
|
+
}
|
17
|
+
end
|
18
|
+
# H4xz0rz
|
19
|
+
let(:uri) { options }
|
20
|
+
end
|
21
|
+
|
22
|
+
describe '#dataset?' do
|
23
|
+
it 'returns true if a table exists' do
|
24
|
+
expect(gateway.dataset?(:users)).to be(true)
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'returns false if a table does not exist' do
|
28
|
+
expect(gateway.dataset?(:not_here)).to be(false)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
describe 'required config' do
|
33
|
+
it 'errors if config does not meet requirements' do
|
34
|
+
expect { ROM::HTTP::Gateway.new({}) }.to raise_error(ROM::HTTP::GatewayConfigurationError)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
metadata
ADDED
@@ -0,0 +1,186 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rom-http
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Piotr Solnica
|
8
|
+
- Andy Holland
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2015-08-13 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rom
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - '='
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 0.9.0.beta1
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - '='
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 0.9.0.beta1
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: equalizer
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ~>
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0.0'
|
35
|
+
- - '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 0.0.9
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ~>
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0.0'
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.0.9
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: thread_safe
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :runtime
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: bundler
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
type: :development
|
70
|
+
prerelease: false
|
71
|
+
version_requirements: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
- !ruby/object:Gem::Dependency
|
77
|
+
name: rspec
|
78
|
+
requirement: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.1'
|
83
|
+
type: :development
|
84
|
+
prerelease: false
|
85
|
+
version_requirements: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ~>
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.1'
|
90
|
+
- !ruby/object:Gem::Dependency
|
91
|
+
name: rake
|
92
|
+
requirement: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ~>
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '10.0'
|
97
|
+
type: :development
|
98
|
+
prerelease: false
|
99
|
+
version_requirements: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ~>
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '10.0'
|
104
|
+
description: HTTP support for ROM
|
105
|
+
email:
|
106
|
+
- piotr.solnica@gmail.com
|
107
|
+
- andyholland1991@aol.com
|
108
|
+
executables: []
|
109
|
+
extensions: []
|
110
|
+
extra_rdoc_files: []
|
111
|
+
files:
|
112
|
+
- .gitignore
|
113
|
+
- .rspec
|
114
|
+
- .rubocop.yml
|
115
|
+
- .rubocop_todo.yml
|
116
|
+
- .travis.yml
|
117
|
+
- Gemfile
|
118
|
+
- LICENSE.txt
|
119
|
+
- README.md
|
120
|
+
- Rakefile
|
121
|
+
- lib/rom-http.rb
|
122
|
+
- lib/rom/http.rb
|
123
|
+
- lib/rom/http/commands.rb
|
124
|
+
- lib/rom/http/commands/create.rb
|
125
|
+
- lib/rom/http/commands/delete.rb
|
126
|
+
- lib/rom/http/commands/update.rb
|
127
|
+
- lib/rom/http/dataset.rb
|
128
|
+
- lib/rom/http/error.rb
|
129
|
+
- lib/rom/http/gateway.rb
|
130
|
+
- lib/rom/http/relation.rb
|
131
|
+
- lib/rom/http/version.rb
|
132
|
+
- rakelib/rubocop.rake
|
133
|
+
- rom-http.gemspec
|
134
|
+
- spec/integration/abstract/commands/create_spec.rb
|
135
|
+
- spec/integration/abstract/commands/delete_spec.rb
|
136
|
+
- spec/integration/abstract/commands/update_spec.rb
|
137
|
+
- spec/integration/abstract/relation_spec.rb
|
138
|
+
- spec/shared/command_behaviour.rb
|
139
|
+
- spec/shared/setup.rb
|
140
|
+
- spec/shared/users_and_tasks.rb
|
141
|
+
- spec/spec_helper.rb
|
142
|
+
- spec/support/mutant.rb
|
143
|
+
- spec/unit/rom/http/commands/create_spec.rb
|
144
|
+
- spec/unit/rom/http/commands/delete_spec.rb
|
145
|
+
- spec/unit/rom/http/commands/update_spec.rb
|
146
|
+
- spec/unit/rom/http/dataset_spec.rb
|
147
|
+
- spec/unit/rom/http/gateway_spec.rb
|
148
|
+
homepage: http://rom-rb.org
|
149
|
+
licenses:
|
150
|
+
- MIT
|
151
|
+
metadata: {}
|
152
|
+
post_install_message:
|
153
|
+
rdoc_options: []
|
154
|
+
require_paths:
|
155
|
+
- lib
|
156
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
157
|
+
requirements:
|
158
|
+
- - '>='
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: '0'
|
161
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
162
|
+
requirements:
|
163
|
+
- - '>='
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '0'
|
166
|
+
requirements: []
|
167
|
+
rubyforge_project:
|
168
|
+
rubygems_version: 2.4.6
|
169
|
+
signing_key:
|
170
|
+
specification_version: 4
|
171
|
+
summary: HTTP support for ROM
|
172
|
+
test_files:
|
173
|
+
- spec/integration/abstract/commands/create_spec.rb
|
174
|
+
- spec/integration/abstract/commands/delete_spec.rb
|
175
|
+
- spec/integration/abstract/commands/update_spec.rb
|
176
|
+
- spec/integration/abstract/relation_spec.rb
|
177
|
+
- spec/shared/command_behaviour.rb
|
178
|
+
- spec/shared/setup.rb
|
179
|
+
- spec/shared/users_and_tasks.rb
|
180
|
+
- spec/spec_helper.rb
|
181
|
+
- spec/support/mutant.rb
|
182
|
+
- spec/unit/rom/http/commands/create_spec.rb
|
183
|
+
- spec/unit/rom/http/commands/delete_spec.rb
|
184
|
+
- spec/unit/rom/http/commands/update_spec.rb
|
185
|
+
- spec/unit/rom/http/dataset_spec.rb
|
186
|
+
- spec/unit/rom/http/gateway_spec.rb
|