Skip to content

Commit 98c5fa1

Browse files
sinisterchipmunkpicandocodigo
authored andcommitted
Require activesupport/all to more closely mirror a production Rails app.
ActiveSupport patches Kernel to add `class_eval` but this behavior wasn't loaded in the test environment. This created a discrepancy between test and prod, causing tests to fail that should have passed and vice versa. Fully loading ActiveSupport makes the test environment more accurate.
1 parent 4ee1708 commit 98c5fa1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

elasticsearch-model/spec/spec_helper.rb

+4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
require 'yaml'
3232
require 'active_record'
3333

34+
# Load all of ActiveSupport to be sure of complete compatibility -
35+
# see https://github.com/elastic/elasticsearch-rails/pull/1075 for details
36+
require 'active_support/all'
37+
3438
unless defined?(ELASTICSEARCH_URL)
3539
ELASTICSEARCH_URL = ENV['ELASTICSEARCH_URL'] || "localhost:#{(ENV['TEST_CLUSTER_PORT'] || 9200)}"
3640
end

0 commit comments

Comments
 (0)