sunstone 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +29 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/README.md +4 -0
- data/Rakefile.rb +37 -0
- data/TODO.md +89 -0
- data/lib/sunstone.rb +361 -0
- data/lib/sunstone/exception.rb +43 -0
- data/lib/sunstone/model.rb +23 -0
- data/lib/sunstone/model/associations.rb +89 -0
- data/lib/sunstone/model/attributes.rb +99 -0
- data/lib/sunstone/model/persistence.rb +168 -0
- data/lib/sunstone/parser.rb +93 -0
- data/lib/sunstone/schema.rb +38 -0
- data/lib/sunstone/type/boolean.rb +19 -0
- data/lib/sunstone/type/date_time.rb +20 -0
- data/lib/sunstone/type/decimal.rb +19 -0
- data/lib/sunstone/type/integer.rb +17 -0
- data/lib/sunstone/type/mutable.rb +16 -0
- data/lib/sunstone/type/string.rb +18 -0
- data/lib/sunstone/type/value.rb +97 -0
- data/sunstone.gemspec +34 -0
- data/test/sunstone/model/associations_test.rb +55 -0
- data/test/sunstone/model/attributes_test.rb +60 -0
- data/test/sunstone/model/persistence_test.rb +173 -0
- data/test/sunstone/model_test.rb +11 -0
- data/test/sunstone/parser_test.rb +124 -0
- data/test/sunstone/schema_test.rb +25 -0
- data/test/sunstone/type/boolean_test.rb +24 -0
- data/test/sunstone/type/date_time_test.rb +31 -0
- data/test/sunstone/type/decimal_test.rb +27 -0
- data/test/sunstone/type/integer_test.rb +29 -0
- data/test/sunstone/type/string_test.rb +54 -0
- data/test/sunstone/type/value_test.rb +27 -0
- data/test/sunstone_test.rb +302 -0
- data/test/test_helper.rb +70 -0
- metadata +318 -0
data/test/test_helper.rb
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
# To make testing/debugging easier, test within this source tree versus an
|
2
|
+
# installed gem
|
3
|
+
dir = File.dirname(__FILE__)
|
4
|
+
root = File.expand_path(File.join(dir, '..'))
|
5
|
+
lib = File.expand_path(File.join(root, 'lib'))
|
6
|
+
|
7
|
+
$LOAD_PATH << lib
|
8
|
+
|
9
|
+
require 'sunstone'
|
10
|
+
require "minitest/autorun"
|
11
|
+
require 'minitest/unit'
|
12
|
+
require 'minitest/reporters'
|
13
|
+
require 'faker'
|
14
|
+
require 'webmock/minitest'
|
15
|
+
require "mocha"
|
16
|
+
require "mocha/mini_test"
|
17
|
+
require 'active_support/testing/time_helpers'
|
18
|
+
|
19
|
+
Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new
|
20
|
+
|
21
|
+
# require 'factory_girl'
|
22
|
+
#
|
23
|
+
# factories_dir = File.join(File.dirname(__FILE__), 'factories')
|
24
|
+
# FactoryGirl.definition_file_paths = [factories_dir]
|
25
|
+
# FactoryGirl.find_definitions
|
26
|
+
|
27
|
+
# File 'lib/active_support/testing/declarative.rb', somewhere in rails....
|
28
|
+
class Minitest::Test
|
29
|
+
|
30
|
+
include ActiveSupport::Testing::TimeHelpers
|
31
|
+
|
32
|
+
def self.test(name, &block)
|
33
|
+
test_name = "test_#{name.gsub(/\s+/,'_')}".to_sym
|
34
|
+
defined = instance_method(test_name) rescue false
|
35
|
+
raise "#{test_name} is already defined in #{self}" if defined
|
36
|
+
if block_given?
|
37
|
+
define_method(test_name, &block)
|
38
|
+
else
|
39
|
+
define_method(test_name) do
|
40
|
+
flunk "No implementation provided for #{name}"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# test/unit backwards compatibility methods
|
46
|
+
alias :assert_raise :assert_raises
|
47
|
+
alias :assert_not_empty :refute_empty
|
48
|
+
alias :assert_not_equal :refute_equal
|
49
|
+
alias :assert_not_in_delta :refute_in_delta
|
50
|
+
alias :assert_not_in_epsilon :refute_in_epsilon
|
51
|
+
alias :assert_not_includes :refute_includes
|
52
|
+
alias :assert_not_instance_of :refute_instance_of
|
53
|
+
alias :assert_not_kind_of :refute_kind_of
|
54
|
+
alias :assert_no_match :refute_match
|
55
|
+
alias :assert_not_nil :refute_nil
|
56
|
+
alias :assert_not_operator :refute_operator
|
57
|
+
alias :assert_not_predicate :refute_predicate
|
58
|
+
alias :assert_not_respond_to :refute_respond_to
|
59
|
+
alias :assert_not_same :refute_same
|
60
|
+
|
61
|
+
# Fails if the block raises an exception.
|
62
|
+
#
|
63
|
+
# assert_nothing_raised do
|
64
|
+
# ...
|
65
|
+
# end
|
66
|
+
def assert_nothing_raised(*args)
|
67
|
+
yield
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
metadata
ADDED
@@ -0,0 +1,318 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sunstone
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jon Bracy
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-08-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rdoc
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: sdoc
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: minitest
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: minitest-reporters
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: mocha
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: faker
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: factory_girl
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: webmock
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: sdoc-templates-42floors
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: wankel
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :runtime
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: cookie_store
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
type: :runtime
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: activesupport
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
202
|
+
type: :runtime
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ">="
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '0'
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: activemodel
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ">="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '0'
|
216
|
+
type: :runtime
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - ">="
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '0'
|
223
|
+
- !ruby/object:Gem::Dependency
|
224
|
+
name: connection_pool
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
requirements:
|
227
|
+
- - ">="
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: '0'
|
230
|
+
type: :runtime
|
231
|
+
prerelease: false
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - ">="
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: '0'
|
237
|
+
description: A library for interacting with REST APIs. Similar to ActiveResource
|
238
|
+
email:
|
239
|
+
- jonbracy@gmail.com
|
240
|
+
executables: []
|
241
|
+
extensions: []
|
242
|
+
extra_rdoc_files: []
|
243
|
+
files:
|
244
|
+
- ".gitignore"
|
245
|
+
- Gemfile
|
246
|
+
- LICENSE
|
247
|
+
- README.md
|
248
|
+
- Rakefile.rb
|
249
|
+
- TODO.md
|
250
|
+
- lib/sunstone.rb
|
251
|
+
- lib/sunstone/exception.rb
|
252
|
+
- lib/sunstone/model.rb
|
253
|
+
- lib/sunstone/model/associations.rb
|
254
|
+
- lib/sunstone/model/attributes.rb
|
255
|
+
- lib/sunstone/model/persistence.rb
|
256
|
+
- lib/sunstone/parser.rb
|
257
|
+
- lib/sunstone/schema.rb
|
258
|
+
- lib/sunstone/type/boolean.rb
|
259
|
+
- lib/sunstone/type/date_time.rb
|
260
|
+
- lib/sunstone/type/decimal.rb
|
261
|
+
- lib/sunstone/type/integer.rb
|
262
|
+
- lib/sunstone/type/mutable.rb
|
263
|
+
- lib/sunstone/type/string.rb
|
264
|
+
- lib/sunstone/type/value.rb
|
265
|
+
- sunstone.gemspec
|
266
|
+
- test/sunstone/model/associations_test.rb
|
267
|
+
- test/sunstone/model/attributes_test.rb
|
268
|
+
- test/sunstone/model/persistence_test.rb
|
269
|
+
- test/sunstone/model_test.rb
|
270
|
+
- test/sunstone/parser_test.rb
|
271
|
+
- test/sunstone/schema_test.rb
|
272
|
+
- test/sunstone/type/boolean_test.rb
|
273
|
+
- test/sunstone/type/date_time_test.rb
|
274
|
+
- test/sunstone/type/decimal_test.rb
|
275
|
+
- test/sunstone/type/integer_test.rb
|
276
|
+
- test/sunstone/type/string_test.rb
|
277
|
+
- test/sunstone/type/value_test.rb
|
278
|
+
- test/sunstone_test.rb
|
279
|
+
- test/test_helper.rb
|
280
|
+
homepage: http://sunstonerb.com
|
281
|
+
licenses: []
|
282
|
+
metadata: {}
|
283
|
+
post_install_message:
|
284
|
+
rdoc_options: []
|
285
|
+
require_paths:
|
286
|
+
- lib
|
287
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
288
|
+
requirements:
|
289
|
+
- - ">="
|
290
|
+
- !ruby/object:Gem::Version
|
291
|
+
version: '0'
|
292
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
293
|
+
requirements:
|
294
|
+
- - ">="
|
295
|
+
- !ruby/object:Gem::Version
|
296
|
+
version: '0'
|
297
|
+
requirements: []
|
298
|
+
rubyforge_project:
|
299
|
+
rubygems_version: 2.2.2
|
300
|
+
signing_key:
|
301
|
+
specification_version: 4
|
302
|
+
summary: A library for interacting with REST APIs
|
303
|
+
test_files:
|
304
|
+
- test/sunstone/model/associations_test.rb
|
305
|
+
- test/sunstone/model/attributes_test.rb
|
306
|
+
- test/sunstone/model/persistence_test.rb
|
307
|
+
- test/sunstone/model_test.rb
|
308
|
+
- test/sunstone/parser_test.rb
|
309
|
+
- test/sunstone/schema_test.rb
|
310
|
+
- test/sunstone/type/boolean_test.rb
|
311
|
+
- test/sunstone/type/date_time_test.rb
|
312
|
+
- test/sunstone/type/decimal_test.rb
|
313
|
+
- test/sunstone/type/integer_test.rb
|
314
|
+
- test/sunstone/type/string_test.rb
|
315
|
+
- test/sunstone/type/value_test.rb
|
316
|
+
- test/sunstone_test.rb
|
317
|
+
- test/test_helper.rb
|
318
|
+
has_rdoc:
|