File tree Expand file tree Collapse file tree 7 files changed +7
-49
lines changed
lib/active_record/connection_adapters/postgis/oid Expand file tree Collapse file tree 7 files changed +7
-49
lines changed Original file line number Diff line number Diff line change 69
69
- name : Run Tests
70
70
run : bundle exec rake test
71
71
env :
72
- PGHOST : 127.0.0.1
72
+ PGHOST : localhost
73
73
PGUSER : postgres
74
74
PGPASSWORD : postgres
75
75
TESTOPTS : --profile=3
Original file line number Diff line number Diff line change 5
5
6
6
gem "pg" , "~> 1.0" , platform : :ruby
7
7
gem "byebug" if ENV [ "BYEBUG" ]
8
- gem "tracer"
9
8
10
9
def activerecord_version
11
10
return ENV [ "AR_VERSION" ] if ENV [ "AR_VERSION" ]
33
32
gem "rails" , github : "rails/rails" , tag : "v#{ activerecord_version } "
34
33
35
34
group :development do
36
- gem "minitest-excludes" , "~> 2.0"
37
-
38
35
# Gems used by the ActiveRecord test suite
39
36
gem "bcrypt"
40
37
gem "sqlite3"
41
38
gem "msgpack"
42
-
43
- # Still used a little bit in our tests.
44
- # TODO: get rid of the dependency
45
- gem "mocha"
46
39
end
Original file line number Diff line number Diff line change @@ -17,18 +17,20 @@ Gem::Specification.new do |spec|
17
17
spec . files = Dir [ "lib/**/*" , "LICENSE.txt" ]
18
18
spec . platform = Gem ::Platform ::RUBY
19
19
20
- # # ruby-lang.org/en/downloads/branches
20
+ # ruby-lang.org/en/downloads/branches
21
21
spec . required_ruby_version = ">= 3.1.0"
22
22
23
23
spec . add_dependency "activerecord" , "~> 7.2.0"
24
24
spec . add_dependency "rgeo-activerecord" , "~> 8.0.0"
25
25
26
26
spec . add_development_dependency "rake" , "~> 13.0"
27
27
spec . add_development_dependency "minitest" , "~> 5.4"
28
+ spec . add_development_dependency "minitest-excludes" , "~> 2.0"
28
29
spec . add_development_dependency "benchmark-ips" , "~> 2.12"
29
30
spec . add_development_dependency "rubocop" , "~> 1.50"
30
31
31
32
spec . metadata = {
33
+ "funding_uri" => "https://opencollective.com/rgeo" ,
32
34
"rubygems_mfa_required" => "true"
33
35
}
34
36
end
Original file line number Diff line number Diff line change @@ -53,22 +53,10 @@ def self.parse_sql_type(sql_type)
53
53
end
54
54
55
55
def spatial_factory
56
- return @spatial_factory if defined? ( @spatial_factory )
57
- @spatial_factory =
56
+ @spatial_factory ||=
58
57
RGeo ::ActiveRecord ::SpatialFactoryStore . instance . factory (
59
58
factory_attrs
60
59
)
61
-
62
- if @srid != @spatial_factory . srid
63
- puts
64
- puts "INITIALIZATION ERROR"
65
- puts
66
- end
67
-
68
- # Tracer is waaay too noisy
69
- # require "tracer"
70
- # Tracer.trace(@spatial_factory)
71
- @spatial_factory
72
60
end
73
61
74
62
def spatial?
@@ -83,18 +71,6 @@ def type
83
71
def serialize ( value )
84
72
return if value . nil?
85
73
geo_value = cast_value ( value )
86
- if spatial_factory . srid != @srid
87
- $something_wrong = true
88
- puts ?* * 100
89
- puts "@geo_type: #{ @geo_type } "
90
- puts "type.to_s: #{ type . to_s } "
91
- puts "@srid: #{ @srid } "
92
- p spatial_factory # It has srid=0 when bugged
93
- p value
94
- p geo_value
95
- puts
96
- puts
97
- end
98
74
99
75
# TODO - only valid types should be allowed
100
76
# e.g. linestring is not valid for point column
Original file line number Diff line number Diff line change @@ -285,7 +285,7 @@ def test_no_query_spatial_column_info
285
285
286
286
# `SpatialColumnInfo#all` queries column info from the database.
287
287
# It should not be called when klass.columns is called
288
- assert_queries_count ( 0 ) do
288
+ assert_no_queries do
289
289
# first column is id, second is name
290
290
refute klass . columns [ 1 ] . spatial?
291
291
assert_nil klass . columns [ 1 ] . has_z
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ def activerecord_test_files
29
29
. map { |file | File . join ar_root , file . strip }
30
30
. sort
31
31
. prepend ( POSTGIS_TEST_HELPER )
32
- . then { FileList [ *_1 ] }
32
+ . then { FileList [ *_1 ] }
33
33
else
34
34
FileList [ "#{ ar_root } /test/cases/**/*_test.rb" ]
35
35
. reject { _1 . include? ( "/adapters/" ) || _1 . include? ( "/encryption/performance" ) }
Original file line number Diff line number Diff line change @@ -82,23 +82,10 @@ def time_it
82
82
end
83
83
end
84
84
85
- $something_wrong = false
86
- $last_test = nil
87
85
module ActiveSupport
88
86
class TestCase
89
87
include TestTimeoutHelper
90
88
91
- teardown do
92
- if $something_wrong
93
- puts
94
- puts "SOMETHING WRONG in test #{ name . inspect } "
95
- puts "ran after #{ $last_test. inspect } "
96
- puts
97
- $something_wrong = false
98
- end
99
- $last_test = name
100
- end
101
-
102
89
def factory ( srid : 3785 )
103
90
RGeo ::Cartesian . preferred_factory ( srid : srid )
104
91
end
You can’t perform that action at this time.
0 commit comments