class SmartTest::Project
Attributes
root[R]
test_folder[R]
Public Class Methods
new(root, test_folder = "spec")
click to toggle source
# File lib/smart_test/project.rb, line 5 def initialize(root, test_folder = "spec") @root = root @test_folder = test_folder raise NoTestFolderError unless File.exists? File.join(root, test_folder) end
Public Instance Methods
test_file?(file)
click to toggle source
# File lib/smart_test/project.rb, line 23 def test_file?(file) file =~ /\A#{test_folder}\/.*#{test_folder}\.rb\Z/i end
test_files()
click to toggle source
# File lib/smart_test/project.rb, line 19 def test_files Dir.glob "#{test_folder}/**/*_#{test_folder}.rb" end
using_bundle?()
click to toggle source
# File lib/smart_test/project.rb, line 11 def using_bundle? @using_bundle ||= File.exists?(File.join root, "Gemfile") end
using_git?()
click to toggle source
# File lib/smart_test/project.rb, line 15 def using_git? @using_git ||= File.exists?(File.join root, ".git") end