sunstone 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -2
- data/ext/active_record/associations/builder/has_and_belongs_to_many.rb +52 -48
- data/ext/active_record/batches.rb +2 -2
- data/ext/active_record/calculations.rb +28 -28
- data/ext/active_record/finder_methods.rb +36 -22
- data/ext/active_record/query_methods.rb +23 -0
- data/ext/active_record/relation.rb +6 -8
- data/ext/active_record/relation/predicate_builder.rb +29 -23
- data/ext/active_record/statement_cache.rb +21 -8
- data/lib/active_record/connection_adapters/sunstone_adapter.rb +0 -2
- data/lib/arel/visitors/sunstone.rb +9 -5
- data/lib/sunstone.rb +9 -3
- data/lib/sunstone/connection.rb +2 -3
- data/lib/sunstone/version.rb +1 -1
- data/sunstone.gemspec +3 -3
- data/test/models/ship.rb +14 -0
- data/test/query_test.rb +128 -0
- data/test/sunstone_test.rb +296 -305
- data/test/test_helper.rb +11 -25
- metadata +13 -8
data/test/test_helper.rb
CHANGED
@@ -1,33 +1,28 @@
|
|
1
1
|
# To make testing/debugging easier, test within this source tree versus an
|
2
2
|
# installed gem
|
3
|
-
|
4
|
-
root = File.expand_path(File.join(dir, '..'))
|
5
|
-
lib = File.expand_path(File.join(root, 'lib'))
|
6
|
-
|
7
|
-
$LOAD_PATH << lib
|
3
|
+
$LOAD_PATH << File.expand_path('../lib', __FILE__)
|
8
4
|
|
9
5
|
require 'sunstone'
|
10
6
|
require "minitest/autorun"
|
11
7
|
require 'minitest/unit'
|
12
8
|
require 'minitest/reporters'
|
13
|
-
require 'faker'
|
14
9
|
require 'webmock/minitest'
|
15
|
-
require "mocha"
|
16
|
-
require "mocha/mini_test"
|
17
|
-
require 'active_support/testing/time_helpers'
|
18
10
|
|
19
|
-
|
11
|
+
Dir.glob(File.expand_path('../models/**/*.rb', __FILE__), &method(:require))
|
12
|
+
|
13
|
+
|
20
14
|
|
21
|
-
# require '
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
25
|
-
|
15
|
+
# require 'faker'
|
16
|
+
# require "mocha"
|
17
|
+
# require "mocha/mini_test"
|
18
|
+
# require 'active_support/testing/time_helpers'
|
19
|
+
|
20
|
+
Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new
|
26
21
|
|
27
22
|
# File 'lib/active_support/testing/declarative.rb', somewhere in rails....
|
28
23
|
class Minitest::Test
|
29
24
|
|
30
|
-
include ActiveSupport::Testing::TimeHelpers
|
25
|
+
# include ActiveSupport::Testing::TimeHelpers
|
31
26
|
|
32
27
|
def self.test(name, &block)
|
33
28
|
test_name = "test_#{name.gsub(/\s+/,'_')}".to_sym
|
@@ -58,13 +53,4 @@ class Minitest::Test
|
|
58
53
|
alias :assert_not_respond_to :refute_respond_to
|
59
54
|
alias :assert_not_same :refute_same
|
60
55
|
|
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
56
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sunstone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Bracy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -212,42 +212,42 @@ dependencies:
|
|
212
212
|
requirements:
|
213
213
|
- - ">="
|
214
214
|
- !ruby/object:Gem::Version
|
215
|
-
version: 4.2.
|
215
|
+
version: 4.2.4
|
216
216
|
type: :runtime
|
217
217
|
prerelease: false
|
218
218
|
version_requirements: !ruby/object:Gem::Requirement
|
219
219
|
requirements:
|
220
220
|
- - ">="
|
221
221
|
- !ruby/object:Gem::Version
|
222
|
-
version: 4.2.
|
222
|
+
version: 4.2.4
|
223
223
|
- !ruby/object:Gem::Dependency
|
224
224
|
name: activemodel
|
225
225
|
requirement: !ruby/object:Gem::Requirement
|
226
226
|
requirements:
|
227
227
|
- - ">="
|
228
228
|
- !ruby/object:Gem::Version
|
229
|
-
version: 4.2.
|
229
|
+
version: 4.2.4
|
230
230
|
type: :runtime
|
231
231
|
prerelease: false
|
232
232
|
version_requirements: !ruby/object:Gem::Requirement
|
233
233
|
requirements:
|
234
234
|
- - ">="
|
235
235
|
- !ruby/object:Gem::Version
|
236
|
-
version: 4.2.
|
236
|
+
version: 4.2.4
|
237
237
|
- !ruby/object:Gem::Dependency
|
238
238
|
name: activerecord
|
239
239
|
requirement: !ruby/object:Gem::Requirement
|
240
240
|
requirements:
|
241
241
|
- - ">="
|
242
242
|
- !ruby/object:Gem::Version
|
243
|
-
version: 4.2.
|
243
|
+
version: 4.2.4
|
244
244
|
type: :runtime
|
245
245
|
prerelease: false
|
246
246
|
version_requirements: !ruby/object:Gem::Requirement
|
247
247
|
requirements:
|
248
248
|
- - ">="
|
249
249
|
- !ruby/object:Gem::Version
|
250
|
-
version: 4.2.
|
250
|
+
version: 4.2.4
|
251
251
|
description: A library for interacting with REST APIs. Similar to ActiveResource
|
252
252
|
email:
|
253
253
|
- jonbracy@gmail.com
|
@@ -265,6 +265,7 @@ files:
|
|
265
265
|
- ext/active_record/batches.rb
|
266
266
|
- ext/active_record/calculations.rb
|
267
267
|
- ext/active_record/finder_methods.rb
|
268
|
+
- ext/active_record/query_methods.rb
|
268
269
|
- ext/active_record/relation.rb
|
269
270
|
- ext/active_record/relation/predicate_builder.rb
|
270
271
|
- ext/active_record/statement_cache.rb
|
@@ -284,6 +285,8 @@ files:
|
|
284
285
|
- lib/sunstone/exception.rb
|
285
286
|
- lib/sunstone/version.rb
|
286
287
|
- sunstone.gemspec
|
288
|
+
- test/models/ship.rb
|
289
|
+
- test/query_test.rb
|
287
290
|
- test/sunstone/connection_test.rb
|
288
291
|
- test/sunstone/parser_test.rb
|
289
292
|
- test/sunstone_test.rb
|
@@ -312,6 +315,8 @@ signing_key:
|
|
312
315
|
specification_version: 4
|
313
316
|
summary: A library for interacting with REST APIs
|
314
317
|
test_files:
|
318
|
+
- test/models/ship.rb
|
319
|
+
- test/query_test.rb
|
315
320
|
- test/sunstone/connection_test.rb
|
316
321
|
- test/sunstone/parser_test.rb
|
317
322
|
- test/sunstone_test.rb
|