sequel-rails 1.1.1 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -1,16 +1,15 @@
1
1
  # sequel-rails
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/sequel-rails.svg)][gem]
4
- [![Build Status](https://secure.travis-ci.org/TalentBox/sequel-rails.svg?branch=master)][travis]
4
+ ![Build Status](https://github.com/TalentBox/sequel-rails/actions/workflows/ci.yml/badge.svg)
5
5
  [![Code Climate](https://codeclimate.com/github/TalentBox/sequel-rails.svg)][codeclimate]
6
6
 
7
7
  [gem]: https://rubygems.org/gems/sequel-rails
8
- [travis]: http://travis-ci.org/TalentBox/sequel-rails
9
8
  [codeclimate]: https://codeclimate.com/github/TalentBox/sequel-rails
10
9
 
11
10
  This gem provides the railtie that allows
12
11
  [sequel](http://github.com/jeremyevans/sequel) to hook into
13
- [Rails (4.x and 5.x)](http://github.com/rails/rails) and thus behave like a
12
+ [Rails (5.2.x, 6.x, 7.x)](http://github.com/rails/rails) and thus behave like a
14
13
  rails framework component. Just like activerecord does in rails,
15
14
  [sequel-rails](http://github.com/talentbox/sequel-rails) uses the railtie API to
16
15
  hook into rails. The two are actually hooked into rails almost identically.
@@ -28,7 +27,7 @@ Since January 2013, we've become the official maintainers of the gem after
28
27
  Using sequel-rails
29
28
  ==================
30
29
 
31
- Using sequel with Rails (4.x or 5.x) requires a couple minor changes.
30
+ Using sequel with Rails (5.2.x, 6.x, 7.x) requires a couple minor changes.
32
31
 
33
32
  First, add the following to your Gemfile (after the `Rails` lines):
34
33
 
@@ -195,6 +194,19 @@ You can configure some options with the usual rails mechanism, in
195
194
  # to fail early
196
195
  config.sequel.test_connect = true
197
196
 
197
+ # Configure what should happend after SequelRails will create new connection with Sequel (applicable only for the first new connection)
198
+ # config.sequel.after_connect = proc do
199
+ # Sequel::Model.plugin :timestamps, update_on_create: true
200
+ # Sequel::Model.db.extension :pg_array, :pg_hstore # database specific extension
201
+ # Sequel.extension :pg_hstore_ops # sequel specific extension
202
+ # end
203
+
204
+ # Configure what should happend after new connection in connection pool is created (applicable only for all connections)
205
+ # to fail early
206
+ # config.sequel.after_new_connection = proc do |db|
207
+ # db.execute('SET statement_timeout = 30000;')
208
+ # end
209
+
198
210
  # If you want to use a specific logger
199
211
  config.sequel.logger = MyLogger.new($stdout)
200
212
  ```
@@ -259,6 +271,27 @@ Here's some examples:
259
271
  database: ":memory:"
260
272
  ```
261
273
 
274
+ after_connect hooks
275
+ ================
276
+
277
+ There are 2 options how to set after_connect hooks in `config/application.rb`
278
+
279
+ 1. `config.sequel.after_connect` will be called only on the first new connection. It can be used for enabling plugins or to set some global sequel settings.
280
+ ```ruby
281
+ config.sequel.after_connect = proc do
282
+ Sequel::Model.plugin :timestamps, update_on_create: true
283
+ Sequel::Model.db.extension :pg_array, :pg_hstore # database specific extension
284
+ Sequel.extension :pg_hstore_ops # sequel specific extension
285
+ end
286
+ ```
287
+
288
+ 2. `config.sequel.after_new_connection` will be called after every new connection in connection pool is created. It can be used to run some specific `SET` commands on every new connection. It's using default `after_connect` hook in sequel. https://sequel.jeremyevans.net/rdoc/classes/Sequel/ConnectionPool.html#attribute-i-after_connect
289
+ ```ruby
290
+ config.sequel.after_new_connection = proc do |db|
291
+ db.execute('SET statement_timeout = 30000;')
292
+ end
293
+ ```
294
+
262
295
  Enabling plugins
263
296
  ================
264
297
 
@@ -358,15 +391,15 @@ Note on Patches/Pull Requests
358
391
  The sequel-rails team
359
392
  =====================
360
393
 
361
- * Jonathan Tron (JonathanTron) - Current maintainer
362
- * Joseph Halter (JosephHalter) - Current maintainer
394
+ * Jonathan Tron (@JonathanTron) - Current maintainer
395
+ * Joseph Halter (@JosephHalter) - Current maintainer
363
396
 
364
397
  Previous maintainer
365
398
  ===================
366
399
 
367
400
  [Original project](https://github.com/brasten/sequel-rails):
368
401
 
369
- * Brasten Sager (brasten) - Project creator
402
+ * Brasten Sager (@brasten) - Project creator
370
403
 
371
404
  Contributors
372
405
  ============
@@ -417,6 +450,14 @@ Improvements have been made by those awesome contributors:
417
450
  * p-leger (@p-leger)
418
451
  * Semyon Pupkov (@artofhuman)
419
452
  * Ben Koshy (@BKSpurgeon)
453
+ * Janko Marohnić (@janko)
454
+ * Adrián Mugnolo (@xymbol)
455
+ * Ivan (@AnotherRegularDude)
456
+ * kamilpavlicko (@kamilpavlicko)
457
+ * Stefan Vermaas (@stefanvermaas)
458
+ * Yuri Smirnov (@tycooon)
459
+ * Mickael Kurmann (@elbouillon)
460
+ * Radoslaw Wojnarowski (@rwojnarowski)
420
461
 
421
462
  Credits
422
463
  =======
@@ -426,4 +467,4 @@ The [dm-rails](http://github.com/datamapper/dm-rails) team wrote most of the ori
426
467
  Copyright
427
468
  =========
428
469
 
429
- Copyright (c) 2010-2013 The sequel-rails team. See [LICENSE](http://github.com/brasten/sequel-rails/blob/master/LICENSE) for details.
470
+ Copyright (c) 2010-2022 The sequel-rails team. See [LICENSE](http://github.com/TalentBox/sequel-rails/blob/master/LICENSE) for details.
data/Rakefile CHANGED
@@ -19,6 +19,7 @@ begin
19
19
  %w(
20
20
  TEST_ADAPTER
21
21
  TEST_DATABASE
22
+ TEST_DATABASE_HOST
22
23
  TEST_OWNER
23
24
  TEST_USERNAME
24
25
  TEST_PASSWORD
@@ -33,10 +34,6 @@ begin
33
34
  'sqlite3' => { 'TEST_DATABASE' => File.join(File.expand_path('.'), 'spec/internal/db/database.sqlite3') },
34
35
  }
35
36
 
36
- configs.merge!(
37
- 'mysql' => { 'TEST_ENCODING' => 'utf8', 'TEST_USERNAME' => 'root' }
38
- ) if RUBY_VERSION < '2.4'
39
-
40
37
  configs.merge!(
41
38
  'mysql2' => { 'TEST_ENCODING' => 'utf8', 'TEST_USERNAME' => 'root', 'TEST_DATABASE' => 'sequel_rails_test_mysql2' }
42
39
  ) unless SequelRails.jruby?
data/ci/rails-5.2.gemfile CHANGED
@@ -10,12 +10,11 @@ gem 'sequel', "#{ENV['SEQUEL']}"
10
10
 
11
11
  gem 'fakefs', '0.11.2', :require => 'fakefs/safe'
12
12
 
13
+ gem 'rspec-rails', '~> 5.0'
14
+
13
15
  # MRI/Rubinius Adapter Dependencies
14
16
  platform :ruby do
15
17
  gem 'pg'
16
- if RUBY_VERSION < '2.4'
17
- gem 'mysql'
18
- end
19
18
  gem 'mysql2'
20
19
  gem 'sqlite3'
21
20
  end
data/ci/rails-6.0.gemfile CHANGED
@@ -10,12 +10,11 @@ gem 'sequel', "#{ENV['SEQUEL']}"
10
10
 
11
11
  gem 'fakefs', '0.11.2', :require => 'fakefs/safe'
12
12
 
13
+ gem 'rspec-rails', '~> 5.0'
14
+
13
15
  # MRI/Rubinius Adapter Dependencies
14
16
  platform :ruby do
15
17
  gem 'pg'
16
- if RUBY_VERSION < '2.4'
17
- gem 'mysql'
18
- end
19
18
  gem 'mysql2'
20
19
  gem 'sqlite3'
21
20
  end
@@ -1,7 +1,8 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'railties', '~> 5.0.7'
4
- gem 'activemodel', '~> 5.0.7'
3
+ gem 'railties', '~> 6.1.0'
4
+ gem 'activemodel', '~> 6.1.0'
5
+ gem 'actionpack', '~> 6.1.0'
5
6
 
6
7
  gemspec :path => '../'
7
8
 
@@ -9,12 +10,11 @@ gem 'sequel', "#{ENV['SEQUEL']}"
9
10
 
10
11
  gem 'fakefs', '0.11.2', :require => 'fakefs/safe'
11
12
 
13
+ gem 'rspec-rails', '~> 5.0'
14
+
12
15
  # MRI/Rubinius Adapter Dependencies
13
16
  platform :ruby do
14
17
  gem 'pg'
15
- if RUBY_VERSION < '2.4'
16
- gem 'mysql'
17
- end
18
18
  gem 'mysql2'
19
19
  gem 'sqlite3'
20
20
  end
@@ -1,6 +1,8 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'railties', '~> 4.0.13'
3
+ gem 'railties', '~> 7.0.0'
4
+ gem 'activemodel', '~> 7.0.0'
5
+ gem 'actionpack', '~> 7.0.0'
4
6
 
5
7
  gemspec :path => '../'
6
8
 
@@ -8,12 +10,11 @@ gem 'sequel', "#{ENV['SEQUEL']}"
8
10
 
9
11
  gem 'fakefs', '0.11.2', :require => 'fakefs/safe'
10
12
 
13
+ gem 'rspec-rails', '~> 5.0'
14
+
11
15
  # MRI/Rubinius Adapter Dependencies
12
16
  platform :ruby do
13
17
  gem 'pg'
14
- if RUBY_VERSION < '2.4'
15
- gem 'mysql'
16
- end
17
18
  gem 'mysql2'
18
19
  gem 'sqlite3'
19
20
  end
@@ -27,6 +27,7 @@ module SequelRails
27
27
  self.schema_dump = default_schema_dump
28
28
  self.load_database_tasks = true
29
29
  self.after_connect = nil
30
+ self.after_new_connection = nil
30
31
  self.skip_connect = nil
31
32
  self.test_connect = true
32
33
  end
@@ -75,6 +76,7 @@ module SequelRails
75
76
  config['search_path'] = search_path if search_path
76
77
  config['servers'] = servers if servers
77
78
  config['test'] = test_connect
79
+ config['after_connect'] = after_new_connection if after_new_connection
78
80
 
79
81
  url = ENV['DATABASE_URL']
80
82
  config['url'] ||= url if url
@@ -26,7 +26,6 @@ module SequelRails
26
26
  def dump_schema_information(opts = {})
27
27
  sql = opts.fetch :sql
28
28
  adapter = SequelRails::Storage.adapter_for(Rails.env)
29
- db = ::Sequel::Model.db
30
29
  res = ''
31
30
 
32
31
  if available_migrations?
@@ -15,7 +15,6 @@ require 'sequel_rails/configuration'
15
15
  require 'sequel_rails/migrations'
16
16
  require 'sequel_rails/railties/log_subscriber'
17
17
  require 'sequel_rails/railties/i18n_support'
18
- require 'sequel_rails/railties/spring_support'
19
18
  require 'sequel_rails/railties/controller_runtime'
20
19
  require 'sequel_rails/sequel/database/active_support_notification'
21
20
  require 'action_dispatch/middleware/session/sequel_store'
@@ -76,19 +75,17 @@ module SequelRails
76
75
  end
77
76
 
78
77
  initializer 'sequel.spring' do |_app|
79
- if defined?(::Spring::Application)
80
- class ::Spring::Application # rubocop:disable Style/ClassAndModuleChildren
81
- include ::SequelRails::SpringSupport
82
- alias_method :disconnect_database_without_sequel, :disconnect_database
83
- alias_method :disconnect_database, :disconnect_database_with_sequel
84
- end
85
- end
78
+ Spring.after_fork { Sequel::DATABASES.each(&:disconnect) } if defined?(Spring)
86
79
  end
87
80
 
88
81
  # Support overwriting crucial steps in subclasses
89
82
  def configure_sequel(app)
90
83
  rails_db_config = begin
91
84
  app.config.database_configuration
85
+ rescue RuntimeError => e
86
+ raise unless e.message =~ /Cannot load database configuration/
87
+
88
+ {} # will try to use DATABASE_URL
92
89
  rescue Errno::ENOENT
93
90
  {} # will try to use DATABASE_URL
94
91
  end
@@ -119,7 +116,7 @@ module SequelRails
119
116
  end
120
117
 
121
118
  def database_create_command?
122
- ["db:create", "db:create:all"].any? { |c| ARGV.include?(c) }
119
+ ['db:create', 'db:create:all'].any? { |c| Rake.application.top_level_tasks.include?(c) }
123
120
  end
124
121
  end
125
122
  end
@@ -47,10 +47,10 @@ module SequelRails
47
47
  end
48
48
 
49
49
  if odd?
50
- name = color(name, :cyan, true)
51
- sql = color(sql, nil, true)
50
+ name = color(name, :cyan, :bold => true)
51
+ sql = color(sql, nil, :bold => true)
52
52
  else
53
- name = color(name, :magenta, true)
53
+ name = color(name, :magenta, :bold => true)
54
54
  end
55
55
 
56
56
  debug " #{name} #{sql}#{binds}"
@@ -15,6 +15,8 @@ module SequelRails
15
15
  end
16
16
 
17
17
  def drop
18
+ return if ::Sequel::DATABASES.size == 0
19
+
18
20
  ::Sequel::Model.db.disconnect
19
21
  res = _drop
20
22
  warn "[sequel] Dropped database '#{database}'" if res
@@ -1,3 +1,3 @@
1
1
  module SequelRails
2
- VERSION = '1.1.1'.freeze
2
+ VERSION = '1.2.1'.freeze
3
3
  end
data/sequel-rails.gemspec CHANGED
@@ -29,12 +29,13 @@ Gem::Specification.new do |s|
29
29
  s.add_dependency 'actionpack', '>= 4.0.0'
30
30
  s.add_dependency 'sequel', ['>= 3.28', '< 6.0']
31
31
 
32
- s.add_development_dependency 'combustion'
32
+ s.add_development_dependency 'combustion', '~> 1.3'
33
33
  s.add_development_dependency 'generator_spec'
34
- s.add_development_dependency 'rake', '>= 0.8.7', '< 12.1'
35
- s.add_development_dependency 'rspec', '~> 3.7'
36
- s.add_development_dependency 'rspec-rails', '~> 3.7'
37
- s.add_development_dependency 'rubocop', '~> 0.52.0'
38
- s.add_development_dependency 'ammeter', '1.1.4'
34
+ s.add_development_dependency 'rake'
35
+ s.add_development_dependency 'rspec'
36
+ s.add_development_dependency 'rspec-rails'
37
+ s.add_development_dependency 'rubocop', '1.27.0'
38
+ s.add_development_dependency 'ammeter', '1.1.5'
39
39
  s.add_development_dependency 'test-unit'
40
+ s.add_development_dependency 'nokogiri', '>= 1.13.4'
40
41
  end
data/spec/helpers/io.rb CHANGED
@@ -4,5 +4,10 @@ module IOSpecHelper
4
4
  # if this isn't a good use for case equality I don't know what is
5
5
  pattern === a.first ? raise(Errno::ENOENT) : m.call(*a) # rubocop:disable CaseEquality
6
6
  end
7
+ # Rails > 6.1 uses Pathname#exists? instead of rescuing read error
8
+ allow(Pathname).to receive(:new).and_call_original
9
+ allow(Pathname).to receive(:new).with(pattern).and_return(
10
+ instance_double(Pathname, :exist? => false)
11
+ )
7
12
  end
8
13
  end
@@ -9,7 +9,7 @@ describe SessionsController, :type => :request do
9
9
  else
10
10
  {:status => 'logged_in'}
11
11
  end
12
- post '/session', opts
12
+ post '/session', **opts
13
13
  end
14
14
 
15
15
  describe '#create' do
@@ -1,6 +1,7 @@
1
1
  test:
2
2
  adapter: "<%= ENV["TEST_ADAPTER"] || "postgresql" %>"
3
3
  database: "<%= ENV["TEST_DATABASE"] || "sequel_rails_test" %>"
4
+ host: "<%= ENV["TEST_DATABASE_HOST"] %>"
4
5
  <% if ENV['TEST_ADAPTER'] != 'sqlite3' %>
5
6
  owner: "<%= ENV["TEST_OWNER"] || ENV["USER"] %>"
6
7
  user: "<%= ENV["TEST_USERNAME"] || ENV["USER"] %>"
@@ -8,6 +9,8 @@ test:
8
9
  <% end %>
9
10
  <% if ENV['TEST_ADAPTER'] =~ /mysql/ %>
10
11
  encoding: "<%= ENV["TEST_ENCODING"] || "utf8" %>"
12
+ port: "<%= ENV["TEST_DATABASE_PORT"] || "3306" %>"
11
13
  <% elsif ENV['TEST_ADAPTER'] =~ /postgres/ %>
12
14
  encoding: "<%= ENV["TEST_ENCODING"] || "unicode" %>"
15
+ port: "<%= ENV["TEST_DATABASE_PORT"] || "5432" %>"
13
16
  <% end %>
@@ -1,10 +1,10 @@
1
1
  Sequel.migration do
2
2
  change do
3
- create_table :users do
3
+ create_table? :users do
4
4
  primary_key :id
5
5
  String :email
6
6
  end
7
- create_table :sessions do
7
+ create_table? :sessions do
8
8
  primary_key :id
9
9
  String :session_id, :null => false, :unique => true, :index => true
10
10
  String :data, :text => true, :null => false
@@ -113,23 +113,33 @@ describe SequelRails::Configuration do
113
113
  end
114
114
 
115
115
  describe '#connect' do
116
+ let(:adapter) { ENV['TEST_ADAPTER'] || 'postgres' }
116
117
  let(:environments) do
117
118
  {
118
119
  'development' => {
119
- 'adapter' => 'postgres',
120
+ 'adapter' => adapter,
120
121
  'owner' => (ENV['TEST_OWNER'] || ENV['USER']),
121
- 'username' => (ENV['TEST_OWNER'] || ENV['USER']),
122
+ 'username' => (ENV['TEST_USERNAME'] || ENV['TEST_OWNER'] || ENV['USER']),
122
123
  'database' => 'sequel_rails_test_storage_dev',
123
- 'host' => '127.0.0.1',
124
+ 'password' => ENV['TEST_PASSWORD'],
125
+ 'host' => ENV['TEST_DATABASE_HOST'],
126
+ 'port' => ENV['TEST_DATABASE_PORT'],
124
127
  },
125
128
  'test' => {
126
- 'adapter' => 'postgres',
129
+ 'adapter' => adapter,
127
130
  'owner' => (ENV['TEST_OWNER'] || ENV['USER']),
128
- 'username' => (ENV['TEST_OWNER'] || ENV['USER']),
131
+ 'username' => (ENV['TEST_USERNAME'] || ENV['TEST_OWNER'] || ENV['USER']),
129
132
  'database' => 'sequel_rails_test_storage_test',
130
- 'host' => '127.0.0.1',
133
+ 'password' => ENV['TEST_PASSWORD'],
134
+ 'host' => ENV['TEST_DATABASE_HOST'],
135
+ 'port' => ENV['TEST_DATABASE_PORT'],
131
136
  },
132
- 'remote' => {
137
+ 'remote_pg' => {
138
+ 'adapter' => 'postgres',
139
+ 'host' => '10.0.0.1',
140
+ 'database' => 'sequel_rails_test_storage_dev',
141
+ },
142
+ 'remote_mysql' => {
133
143
  'adapter' => 'mysql',
134
144
  'host' => '10.0.0.1',
135
145
  'database' => 'sequel_rails_test_storage_remote',
@@ -315,7 +325,7 @@ describe SequelRails::Configuration do
315
325
  end
316
326
  end
317
327
 
318
- let(:environment) { 'development' }
328
+ let(:environment) { 'remote_pg' }
319
329
 
320
330
  context 'in C-Ruby' do
321
331
  include_examples 'test_connect'
@@ -347,7 +357,7 @@ describe SequelRails::Configuration do
347
357
  expect(::Sequel).to receive(:connect) do |url, hash|
348
358
  expect(url).to start_with('jdbc:postgresql://')
349
359
  expect(hash[:adapter]).to eq('jdbc:postgresql')
350
- expect(hash[:host]).to eq('127.0.0.1')
360
+ expect(hash[:host]).to eq('10.0.0.1')
351
361
  end
352
362
  subject.connect environment
353
363
  end
@@ -367,7 +377,7 @@ describe SequelRails::Configuration do
367
377
  end
368
378
 
369
379
  context 'for a mysql connection' do
370
- let(:environment) { 'remote' }
380
+ let(:environment) { 'remote_mysql' }
371
381
 
372
382
  context 'in C-Ruby' do
373
383
  include_examples 'test_connect'
@@ -427,5 +437,16 @@ describe SequelRails::Configuration do
427
437
  subject.connect environment
428
438
  end
429
439
  end
440
+
441
+ describe 'after each connection hook' do
442
+ let(:environment) { 'development' }
443
+
444
+ it 'runs hook if provided' do
445
+ called = 0
446
+ subject.after_new_connection = ->(_conn){ called += 1 }
447
+ subject.connect environment
448
+ expect(called).to eq(1)
449
+ end
450
+ end
430
451
  end
431
452
  end
@@ -10,7 +10,9 @@ describe SequelRails::Migrations do
10
10
  context 'with no version specified' do
11
11
  it 'runs migrations using Sequel::Migrator' do
12
12
  expect(::Sequel::Migrator).to receive(:run).with(
13
- db, Rails.root.join('db/migrate'), allow_missing_migration_files: false
13
+ db,
14
+ Rails.root.join('db/migrate'),
15
+ { :allow_missing_migration_files => false }
14
16
  ).and_return result
15
17
  expect(described_class.send(migration_method)).to be(result)
16
18
  end
@@ -18,7 +20,9 @@ describe SequelRails::Migrations do
18
20
  context 'with version specified' do
19
21
  it 'runs migrations using Sequel::Migrator' do
20
22
  expect(::Sequel::Migrator).to receive(:run).with(
21
- db, Rails.root.join('db/migrate'), allow_missing_migration_files: false, target: 1
23
+ db,
24
+ Rails.root.join('db/migrate'),
25
+ { :allow_missing_migration_files => false, :target => 1 }
22
26
  ).and_return result
23
27
  expect(described_class.send(migration_method, 1)).to be(result)
24
28
  end
@@ -36,7 +40,9 @@ describe SequelRails::Migrations do
36
40
 
37
41
  it 'runs migrations using Sequel::Migrator' do
38
42
  expect(::Sequel::Migrator).to receive(:run).with(
39
- db, Rails.root.join('db/migrate'), allow_missing_migration_files: true
43
+ db,
44
+ Rails.root.join('db/migrate'),
45
+ { :allow_missing_migration_files => true }
40
46
  ).and_return result
41
47
 
42
48
  described_class.send(migration_method)
@@ -93,8 +93,12 @@ describe SequelRails::Railtie do
93
93
 
94
94
  context 'and DATABASE_URL is defined' do
95
95
  let :database_url do
96
- cfg = Combustion::Application.config.database_configuration['test']
97
- SequelRails::DbConfig.new(cfg).url
96
+ if ENV['TEST_ADAPTER']=~/sqlite/
97
+ 'sqlite:/' # in-memory db
98
+ else
99
+ cfg = Combustion::Application.config.database_configuration['test']
100
+ SequelRails::DbConfig.new(cfg).url
101
+ end
98
102
  end
99
103
 
100
104
  around do |ex|
@@ -83,6 +83,17 @@ describe SequelRails::Storage::Postgres, :postgres do
83
83
  end
84
84
  end
85
85
 
86
+ describe '#drop' do
87
+ before do
88
+ stub_const('Sequel::DATABASES', [])
89
+ end
90
+
91
+ it 'properly executes without active sequel connections' do
92
+ expect(Sequel::Model).not_to receive(:db)
93
+ subject.drop
94
+ end
95
+ end
96
+
86
97
  describe '#_dump' do
87
98
  let(:dump_file_name) { 'dump.sql' }
88
99
  it 'uses the pg_dump command' do
@@ -17,7 +17,10 @@ describe SequelRails::Storage::Sqlite, :sqlite do
17
17
  it 'defer to Sequel' do
18
18
  path = double(:path)
19
19
  allow(subject).to receive(:path).and_return path
20
- expect(::Sequel).to receive(:connect).with('adapter' => 'sqlite3', 'database' => path)
20
+ expect(::Sequel).to receive(:connect).with({
21
+ 'adapter' => 'sqlite3',
22
+ 'database' => path
23
+ })
21
24
  subject._create
22
25
  end
23
26
  end
data/spec/spec_helper.rb CHANGED
@@ -13,7 +13,7 @@ require 'ammeter/init'
13
13
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
14
14
 
15
15
  rspec_exclusions = {}
16
- rspec_exclusions[:skip_jdbc] = SequelRails.jruby?
16
+ rspec_exclusions[:skip_jdbc] = !SequelRails.jruby?
17
17
  rspec_exclusions[:postgres] = ENV['TEST_ADAPTER'] != 'postgresql'
18
18
  rspec_exclusions[:mysql] = !%w(mysql mysql2).include?(ENV['TEST_ADAPTER'])
19
19
  rspec_exclusions[:sqlite] = ENV['TEST_ADAPTER'] != 'sqlite3'