Skip to content

Commit 9876ae0

Browse files
committed
[RAILS] Update test tasks
1 parent 2002b45 commit 9876ae0

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

elasticsearch-rails/Rakefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@ namespace :test do
2828
end
2929
end
3030

31+
namespace :bundle do
32+
desc 'Install gem dependencies'
33+
task :install do
34+
puts '-'*80
35+
Bundler.with_clean_env do
36+
sh 'bundle install'
37+
end
38+
puts '-'*80
39+
end
40+
end
41+
3142
# ----- Documentation tasks ---------------------------------------------------
3243

3344
require 'yard'

elasticsearch-rails/test/test_helper.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
RUBY_1_8 = defined?(RUBY_VERSION) && RUBY_VERSION < '1.9'
2+
unless defined?(ELASTICSEARCH_URL)
3+
ELASTICSEARCH_URL = ENV['ELASTICSEARCH_URL'] || "localhost:#{(ENV['TEST_CLUSTER_PORT'] || 9200)}"
4+
end
25

36
exit(0) if RUBY_1_8
47

@@ -56,7 +59,7 @@ def setup
5659
tracer = ::Logger.new(STDERR)
5760
tracer.formatter = lambda { |s, d, p, m| "#{m.gsub(/^.*$/) { |n| ' ' + n }.ansi(:faint)}\n" }
5861

59-
Elasticsearch::Model.client = Elasticsearch::Client.new host: "localhost:#{(ENV['TEST_CLUSTER_PORT'] || 9250)}",
62+
Elasticsearch::Model.client = Elasticsearch::Client.new host: ELASTICSEARCH_URL,
6063
tracer: (ENV['QUIET'] ? nil : tracer)
6164
end
6265
end

0 commit comments

Comments
 (0)