Skip to content

Commit 36af474

Browse files
committed
Fix up requires and confusing environment variable names.
1 parent 9cd7510 commit 36af474

File tree

9 files changed

+32
-35
lines changed

9 files changed

+32
-35
lines changed

.travis.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ env:
1818
- VERBOSE=true
1919
- TIMEOUT=1
2020
matrix:
21-
- conn=ruby REDIS_BRANCH=3.0
22-
- conn=ruby REDIS_BRANCH=3.2
23-
- conn=hiredis REDIS_BRANCH=3.0
24-
- conn=hiredis REDIS_BRANCH=3.2
25-
- conn=synchrony REDIS_BRANCH=3.0
26-
- conn=synchrony REDIS_BRANCH=3.2
27-
- conn=ruby REDIS_BRANCH=unstable
21+
- DRIVER=ruby REDIS_BRANCH=3.0
22+
- DRIVER=ruby REDIS_BRANCH=3.2
23+
- DRIVER=hiredis REDIS_BRANCH=3.0
24+
- DRIVER=hiredis REDIS_BRANCH=3.2
25+
- DRIVER=synchrony REDIS_BRANCH=3.0
26+
- DRIVER=synchrony REDIS_BRANCH=3.2
27+
- DRIVER=ruby REDIS_BRANCH=unstable
2828

2929
branches:
3030
only:
@@ -35,30 +35,30 @@ matrix:
3535
# hiredis
3636
- rvm: jruby-9
3737
gemfile: .travis/Gemfile
38-
env: conn=hiredis REDIS_BRANCH=3.0
38+
env: DRIVER=hiredis REDIS_BRANCH=3.0
3939
- rvm: jruby-9
4040
gemfile: .travis/Gemfile
41-
env: conn=hiredis REDIS_BRANCH=3.2
41+
env: DRIVER=hiredis REDIS_BRANCH=3.2
4242
- rvm: jruby-9
4343
gemfile: .travis/Gemfile
44-
env: conn=hiredis REDIS_BRANCH=3.0
44+
env: DRIVER=hiredis REDIS_BRANCH=3.0
4545
- rvm: jruby-9
4646
gemfile: .travis/Gemfile
47-
env: conn=hiredis REDIS_BRANCH=3.2
47+
env: DRIVER=hiredis REDIS_BRANCH=3.2
4848

4949
# synchrony
5050
- rvm: jruby-9
5151
gemfile: .travis/Gemfile
52-
env: conn=synchrony REDIS_BRANCH=3.0
52+
env: DRIVER=synchrony REDIS_BRANCH=3.0
5353
- rvm: jruby-9
5454
gemfile: .travis/Gemfile
55-
env: conn=synchrony REDIS_BRANCH=3.2
55+
env: DRIVER=synchrony REDIS_BRANCH=3.2
5656
- rvm: jruby-9
5757
gemfile: .travis/Gemfile
58-
env: conn=synchrony REDIS_BRANCH=3.0
58+
env: DRIVER=synchrony REDIS_BRANCH=3.0
5959
- rvm: jruby-9
6060
gemfile: .travis/Gemfile
61-
env: conn=synchrony REDIS_BRANCH=3.2
61+
env: DRIVER=synchrony REDIS_BRANCH=3.2
6262
allow_failures:
6363
- rvm: rbx-3
6464

redis.gemspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,6 @@ Gem::Specification.new do |s|
3535
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
3636

3737
s.add_development_dependency("test-unit", "3.1.5")
38+
s.add_development_dependency("hiredis")
39+
s.add_development_dependency("em-synchrony")
3840
end

test/client_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require File.expand_path("helper", File.dirname(__FILE__))
1+
require_relative "helper"
22

33
class TestClient < Test::Unit::TestCase
44

test/helper.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
$VERBOSE = true
66

7-
ENV["conn"] ||= "ruby"
7+
ENV["DRIVER"] ||= "ruby"
88

99
require_relative "../lib/redis"
10-
require_relative "../lib/redis/connection/#{ENV["conn"]}"
10+
require_relative "../lib/redis/connection/#{ENV["DRIVER"]}"
1111

1212
require_relative "support/redis_mock"
13-
require_relative "support/connection/#{ENV["conn"]}"
13+
require_relative "support/connection/#{ENV["DRIVER"]}"
1414

1515
PORT = 6381
1616
OPTIONS = {:port => PORT, :db => 15, :timeout => Float(ENV["TIMEOUT"] || 0.1)}
@@ -45,7 +45,7 @@ def init(redis)
4545
end
4646

4747
def driver(*drivers, &blk)
48-
if drivers.map(&:to_s).include?(ENV["conn"])
48+
if drivers.map(&:to_s).include?(ENV["DRIVER"])
4949
class_eval(&blk)
5050
end
5151
end
@@ -172,7 +172,7 @@ def _format_options(options)
172172
end
173173

174174
def _new_client(options = {})
175-
Redis.new(_format_options(options).merge(:driver => ENV["conn"]))
175+
Redis.new(_format_options(options).merge(:driver => ENV["DRIVER"]))
176176
end
177177
end
178178

test/sentinel_command_test.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# encoding: UTF-8
2-
3-
require File.expand_path("helper", File.dirname(__FILE__))
1+
require_relative "helper"
42

53
class SentinelCommandsTest < Test::Unit::TestCase
64

test/ssl_test.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# encoding: UTF-8
2-
3-
require File.expand_path("helper", File.dirname(__FILE__))
1+
require_relative "helper"
42

53
class SslTest < Test::Unit::TestCase
64

test/support/connection/hiredis.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
require "support/wire/thread"
1+
require_relative "../wire/thread"

test/support/connection/synchrony.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require "support/wire/synchrony"
1+
require_relative "../wire/synchrony"
22

33
module Helper
44
def around

test/synchrony_driver.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
require 'em-synchrony'
2-
require 'em-synchrony/connection_pool'
1+
require "em-synchrony"
2+
require "em-synchrony/connection_pool"
33

4-
require 'redis'
5-
require 'redis/connection/synchrony'
4+
require_relative "../lib/redis"
5+
require_relative "../lib/redis/connection/synchrony"
66

7-
8-
require_relative "./helper"
7+
require_relative "helper"
98

109
PORT = 6381
1110
OPTIONS = {:port => PORT, :db => 15}

0 commit comments

Comments
 (0)