Class: RSpec::Core::CommandLineConfiguration::Autotest
- Inherits:
-
Object
- Object
- RSpec::Core::CommandLineConfiguration::Autotest
- Defined in:
- lib/rspec/core/command_line_configuration.rb
Class Method Summary collapse
- .create_dot_rspec_file ⇒ Object
- .discover_file_exists? ⇒ Boolean
- .discover_file_path ⇒ Object
- .generate ⇒ Object
- .remove_autotest_dir_if_present ⇒ Object
Class Method Details
.create_dot_rspec_file ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/rspec/core/command_line_configuration.rb', line 33 def create_dot_rspec_file puts "Autotest loads RSpec's Autotest subclass when there is a .rspec file in the project's root directory." if File.exist?('./.rspec') puts ".rspec file already exists, so nothing was changed." else FileUtils.touch('./.rspec') puts ".rspec file did not exist, so it was created." end end |
.discover_file_exists? ⇒ Boolean
51 52 53 |
# File 'lib/rspec/core/command_line_configuration.rb', line 51 def discover_file_exists? File.exist?(discover_file_path) end |
.discover_file_path ⇒ Object
55 56 57 |
# File 'lib/rspec/core/command_line_configuration.rb', line 55 def discover_file_path File.join('autotest', 'discover.rb') end |
.generate ⇒ Object
28 29 30 31 |
# File 'lib/rspec/core/command_line_configuration.rb', line 28 def generate create_dot_rspec_file remove_autotest_dir_if_present end |
.remove_autotest_dir_if_present ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/rspec/core/command_line_configuration.rb', line 43 def remove_autotest_dir_if_present if discover_file_exists? print "Delete obsolete autotest/discover.rb [y/n]? " exit if gets !~ /y/i FileUtils.rm_rf(discover_file_path) end end |