Skip to content

Commit 5b41ff1

Browse files
committed
Use guard terminal notififier.
1 parent 10aac34 commit 5b41ff1

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
source 'https://rubygems.org'
22
gemspec
33

4+
if RbConfig::CONFIG["host_os"] =~ /darwin/
5+
gem 'terminal-notifier-guard'
6+
end
7+
48
if ENV['RAILS_SOURCE']
59
gemspec path: ENV['RAILS_SOURCE']
610
else

Guardfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
require_relative 'test/support/paths_sqlserver'
22

3+
notification :terminal_notifier if Guard::Notifier::TerminalNotifier.available?
4+
35
guard :minitest, {
46
all_on_start: false,
57
autorun: false,

Rakefile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
require 'rake/testtask'
22
require_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-
104
def 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

test/support/paths_sqlserver.rb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff 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
4045
end
4146

42-
ARTest::Sqlserver.test_root_activerecord_add_to_load_path
47+
ARTest::Sqlserver.add_to_load_paths!
4348
ARTest::Sqlserver.arconfig_file_env!

0 commit comments

Comments
 (0)