File tree Expand file tree Collapse file tree 4 files changed +17
-12
lines changed Expand file tree Collapse file tree 4 files changed +17
-12
lines changed Original file line number Diff line number Diff line change 11source 'https://rubygems.org'
22gemspec
33
4+ if RbConfig ::CONFIG [ "host_os" ] =~ /darwin/
5+ gem 'terminal-notifier-guard'
6+ end
7+
48if ENV [ 'RAILS_SOURCE' ]
59 gemspec path : ENV [ 'RAILS_SOURCE' ]
610else
Original file line number Diff line number Diff line change 11require_relative 'test/support/paths_sqlserver'
22
3+ notification :terminal_notifier if Guard ::Notifier ::TerminalNotifier . available?
4+
35guard :minitest , {
46 all_on_start : false ,
57 autorun : false ,
Original file line number Diff line number Diff line change 11require 'rake/testtask'
22require_relative 'test/support/paths_sqlserver'
33
4- def test_libs
5- ar_lib = File . join ARTest ::Sqlserver . root_activerecord , 'lib'
6- ar_test = File . join ARTest ::Sqlserver . root_activerecord , 'test'
7- [ 'lib' , 'test' , ar_lib , ar_test ]
8- end
9-
104def test_files
115 test_setup = [ 'test/cases/helper_sqlserver.rb' ]
126 return test_setup + ( ENV [ 'TEST_FILES' ] ) . split ( ',' ) if ENV [ 'TEST_FILES' ]
@@ -30,7 +24,7 @@ namespace :test do
3024 %w( dblib odbc ) . each do |mode |
3125
3226 Rake ::TestTask . new ( mode ) do |t |
33- t . libs = test_libs
27+ t . libs = ARTest :: Sqlserver . test_load_paths
3428 t . test_files = test_files
3529 t . verbose = true
3630 end
@@ -56,7 +50,7 @@ namespace :profile do
5650 Dir . glob ( 'test/profile/*_profile_case.rb' ) . sort . each do |test_file |
5751 profile_case = File . basename ( test_file ) . sub ( '_profile_case.rb' , '' )
5852 Rake ::TestTask . new ( profile_case ) do |t |
59- t . libs = test_libs
53+ t . libs = ARTest :: Sqlserver . test_load_paths
6054 t . test_files = [ test_file ]
6155 t . verbose = true
6256 end
Original file line number Diff line number Diff line change @@ -19,9 +19,14 @@ def test_root_activerecord
1919 File . join root_activerecord , 'test'
2020 end
2121
22- def test_root_activerecord_add_to_load_path
23- return if $LOAD_PATH. include? test_root_activerecord
24- $LOAD_PATH. unshift ( test_root_activerecord )
22+ def test_load_paths
23+ ar_lib = File . join root_activerecord , 'lib'
24+ ar_test = File . join root_activerecord , 'test'
25+ [ 'lib' , 'test' , ar_lib , ar_test ]
26+ end
27+
28+ def add_to_load_paths!
29+ test_load_paths . each { |p | $LOAD_PATH. unshift ( p ) unless $LOAD_PATH. include? ( p ) }
2530 end
2631
2732 def migrations_root
@@ -39,5 +44,5 @@ def arconfig_file_env!
3944 end
4045end
4146
42- ARTest ::Sqlserver . test_root_activerecord_add_to_load_path
47+ ARTest ::Sqlserver . add_to_load_paths!
4348ARTest ::Sqlserver . arconfig_file_env!
You can’t perform that action at this time.
0 commit comments