Skip to content

Commit df0de63

Browse files
committed
Fix sqlite tests in Travis
1 parent ba5744f commit df0de63

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
/tmp/
99

1010
.byebug_history
11-
test.sqlite3
11+
test.sqlite
1212

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ cache: bundler
77
before_install: gem install bundler -v 2.1.4
88
before_script: createdb sql_spy_test
99
env:
10-
- DATABASE_URL=sqlite3:///sql_spy_test.sqlite3
10+
- DATABASE_URL=sqlite3:///tmp/sql_spy_test.sqlite
1111
- DATABASE_URL=postgres:///sql_spy_test

test/sql_spy_test.rb

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
require "active_record"
33
require "pg"
44
require "sqlite3"
5+
require_relative "../lib/sql_spy"
56

6-
ENV["DATABASE_URL"] ||= "sqlite3://" + File.expand_path("../test.sqlite3", __dir__)
7+
ENV["DATABASE_URL"] ||= "sqlite3://" + File.expand_path("../test.sqlite", __dir__)
78
ActiveRecord::Base.establish_connection(ENV["DATABASE_URL"])
89

910
ActiveRecord::Schema.define do
@@ -29,8 +30,6 @@ class Post < ActiveRecord::Base
2930
belongs_to :user
3031
end
3132

32-
require_relative "../lib/sql_spy"
33-
3433
Minitest.after_run do
3534
config = ActiveRecord::Base.connection_config
3635
if config[:adapter] == "sqlite3" && File.file?(config[:database])

0 commit comments

Comments
 (0)