1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/railties/test/code_statistics_test.rb
Matthew Draper 87b3e226d6 Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
This reverts commit 3420a14590, reversing
changes made to afb66a5a59.
2017-07-02 02:15:17 +09:30

32 lines
750 B
Ruby

require "abstract_unit"
require "rails/code_statistics"
class CodeStatisticsTest < ActiveSupport::TestCase
def setup
@tmp_path = File.expand_path("fixtures/tmp", __dir__)
@dir_js = File.join(@tmp_path, "lib.js")
FileUtils.mkdir_p(@dir_js)
end
def teardown
FileUtils.rm_rf(@tmp_path)
end
test "ignores directories that happen to have source files extensions" do
assert_nothing_raised do
@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