aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2016-01-18 19:47:17 +0100
committerKasper Timm Hansen <kaspth@gmail.com>2016-01-18 19:47:17 +0100
commitb505d45a5cd2343eb5b662cda5f48b4a63b397f1 (patch)
treebf566a2a4549ff5a65234726b236af8c320fe1dc /railties/test
parent75f1b229fdb340b2cdaf632bb6a223213f05dc75 (diff)
parentef233bba9a0770ada1ebb45c804a319777bbff45 (diff)
downloadrails-b505d45a5cd2343eb5b662cda5f48b4a63b397f1.tar.gz
rails-b505d45a5cd2343eb5b662cda5f48b4a63b397f1.tar.bz2
rails-b505d45a5cd2343eb5b662cda5f48b4a63b397f1.zip
Merge pull request #23006 from Edouard-chin/code_statistic_ignore_hidde_files
CodeStatistic will now ignore hidden files:
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/code_statistics_test.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/railties/test/code_statistics_test.rb b/railties/test/code_statistics_test.rb
index 1b1ff80bc1..4d80901217 100644
--- a/railties/test/code_statistics_test.rb
+++ b/railties/test/code_statistics_test.rb
@@ -4,7 +4,7 @@ require 'rails/code_statistics'
class CodeStatisticsTest < ActiveSupport::TestCase
def setup
@tmp_path = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures', 'tmp'))
- @dir_js = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures', 'tmp', 'lib.js'))
+ @dir_js = File.join(@tmp_path, 'lib.js')
FileUtils.mkdir_p(@dir_js)
end
@@ -17,4 +17,17 @@ class CodeStatisticsTest < ActiveSupport::TestCase
@code_statistics = CodeStatistics.new(['tmp dir', @tmp_path])
end
end
+
+ test 'ignores hidden files' do
+ File.write File.join(@tmp_path, '.example.rb'), <<-CODE
+ def foo
+ puts 'foo'
+ end
+ CODE
+
+ assert_nothing_raised do
+ CodeStatistics.new(['hidden file', @tmp_path])
+ end
+ end
+
end