diff options
author | ☈king <rking@sharpsaw.org> | 2012-11-14 22:37:37 -0700 |
---|---|---|
committer | rking@sharpsaw.org <> | 2012-11-15 18:59:51 -0600 |
commit | 848b6bdbeb30115b537dc55b0eb07358b7d5534f (patch) | |
tree | 6af3c21188ad7a73d912406b6f3ddce75edaf3c4 | |
parent | 7a5d21ba746c49a0d3d344553e9c43bbb89cd57e (diff) | |
download | pry-848b6bdbeb30115b537dc55b0eb07358b7d5534f.tar.gz |
Rename for tabcompletion-friendliness.
-rw-r--r-- | Guardfile | 28 | ||||
-rw-r--r-- | Rakefile | 7 | ||||
-rw-r--r-- | spec/candidate_helper1.rb (renamed from test/candidate_helper1.rb) | 0 | ||||
-rw-r--r-- | spec/candidate_helper2.rb (renamed from test/candidate_helper2.rb) | 0 | ||||
-rw-r--r-- | spec/cli_spec.rb (renamed from test/test_cli.rb) | 0 | ||||
-rw-r--r-- | spec/code_spec.rb (renamed from test/test_code.rb) | 6 | ||||
-rw-r--r-- | spec/command_helpers_spec.rb (renamed from test/test_command_helpers.rb) | 0 | ||||
-rw-r--r-- | spec/command_integration_spec.rb (renamed from test/test_command_integration.rb) | 0 | ||||
-rw-r--r-- | spec/command_set_spec.rb (renamed from test/test_command_set.rb) | 0 | ||||
-rw-r--r-- | spec/command_spec.rb (renamed from test/test_command.rb) | 0 | ||||
-rw-r--r-- | spec/commands/amend_line_spec.rb (renamed from test/test_commands/test_amend_line.rb) | 0 | ||||
-rw-r--r-- | spec/commands/bang_spec.rb (renamed from test/test_commands/test_bang.rb) | 0 | ||||
-rw-r--r-- | spec/commands/cat_spec.rb (renamed from test/test_commands/test_cat.rb) | 0 | ||||
-rw-r--r-- | spec/commands/cd_spec.rb (renamed from test/test_commands/test_cd.rb) | 0 | ||||
-rw-r--r-- | spec/commands/disable_pry_spec.rb (renamed from test/test_commands/test_disable_pry.rb) | 0 | ||||
-rw-r--r-- | spec/commands/edit_method_spec.rb (renamed from test/test_commands/test_edit_method.rb) | 0 | ||||
-rw-r--r-- | spec/commands/edit_spec.rb (renamed from test/test_commands/test_edit.rb) | 0 | ||||
-rw-r--r-- | spec/commands/example.erb (renamed from test/test_commands/example.erb) | 0 | ||||
-rw-r--r-- | spec/commands/exit_all_spec.rb (renamed from test/test_commands/test_exit_all.rb) | 0 | ||||
-rw-r--r-- | spec/commands/exit_program_spec.rb (renamed from test/test_commands/test_exit_program.rb) | 0 | ||||
-rw-r--r-- | spec/commands/exit_spec.rb (renamed from test/test_commands/test_exit.rb) | 0 | ||||
-rw-r--r-- | spec/commands/find_method_spec.rb (renamed from test/test_commands/test_find_method.rb) | 0 | ||||
-rw-r--r-- | spec/commands/gem_list_spec.rb (renamed from test/test_commands/test_gem_list.rb) | 0 | ||||
-rw-r--r-- | spec/commands/help_spec.rb (renamed from test/test_commands/test_help.rb) | 0 | ||||
-rw-r--r-- | spec/commands/hist_spec.rb (renamed from test/test_commands/test_hist.rb) | 0 | ||||
-rw-r--r-- | spec/commands/jump_to_spec.rb (renamed from test/test_commands/test_jump_to.rb) | 0 | ||||
-rw-r--r-- | spec/commands/ls_spec.rb (renamed from test/test_commands/test_ls.rb) | 0 | ||||
-rw-r--r-- | spec/commands/play_spec.rb (renamed from test/test_commands/test_play.rb) | 0 | ||||
-rw-r--r-- | spec/commands/raise_up_spec.rb (renamed from test/test_commands/test_raise_up.rb) | 0 | ||||
-rw-r--r-- | spec/commands/save_file_spec.rb (renamed from test/test_commands/test_save_file.rb) | 0 | ||||
-rw-r--r-- | spec/commands/show_doc_spec.rb (renamed from test/test_commands/test_show_doc.rb) | 0 | ||||
-rw-r--r-- | spec/commands/show_input_spec.rb (renamed from test/test_commands/test_show_input.rb) | 0 | ||||
-rw-r--r-- | spec/commands/show_source_spec.rb (renamed from test/test_commands/test_show_source.rb) | 0 | ||||
-rw-r--r-- | spec/commands/whereami_spec.rb (renamed from test/test_commands/test_whereami.rb) | 4 | ||||
-rw-r--r-- | spec/completion_spec.rb (renamed from test/test_completion.rb) | 0 | ||||
-rw-r--r-- | spec/control_d_handler_spec.rb (renamed from test/test_control_d_handler.rb) | 0 | ||||
-rw-r--r-- | spec/example_nesting.rb (renamed from test/example_nesting.rb) | 0 | ||||
-rw-r--r-- | spec/exception_whitelist_spec.rb (renamed from test/test_exception_whitelist.rb) | 0 | ||||
-rw-r--r-- | spec/helper.rb (renamed from test/helper.rb) | 0 | ||||
-rw-r--r-- | spec/history_array_spec.rb (renamed from test/test_history_array.rb) | 0 | ||||
-rw-r--r-- | spec/hooks_spec.rb (renamed from test/test_hooks.rb) | 0 | ||||
-rw-r--r-- | spec/indent_spec.rb (renamed from test/test_indent.rb) | 2 | ||||
-rw-r--r-- | spec/input_stack_spec.rb (renamed from test/test_input_stack.rb) | 0 | ||||
-rw-r--r-- | spec/method_spec.rb (renamed from test/test_method.rb) | 0 | ||||
-rw-r--r-- | spec/prompt_spec.rb (renamed from test/test_prompt.rb) | 0 | ||||
-rw-r--r-- | spec/pry_defaults_spec.rb (renamed from test/test_pry_defaults.rb) | 0 | ||||
-rw-r--r-- | spec/pry_history_spec.rb (renamed from test/test_pry_history.rb) | 0 | ||||
-rw-r--r-- | spec/pry_output_spec.rb (renamed from test/test_pry_output.rb) | 0 | ||||
-rw-r--r-- | spec/pry_spec.rb (renamed from test/test_pry.rb) | 0 | ||||
-rw-r--r-- | spec/sticky_locals_spec.rb (renamed from test/test_sticky_locals.rb) | 0 | ||||
-rw-r--r-- | spec/syntax_checking_spec.rb (renamed from test/test_syntax_checking.rb) | 0 | ||||
-rw-r--r-- | spec/testrc (renamed from test/testrc) | 0 | ||||
-rw-r--r-- | spec/testrcbad (renamed from test/testrcbad) | 0 | ||||
-rw-r--r-- | spec/wrapped_module_spec.rb (renamed from test/test_wrapped_module.rb) | 0 |
54 files changed, 26 insertions, 21 deletions
@@ -3,14 +3,16 @@ require 'guard/guard' module ::Guard class Bacon < Guard def run_all - system "bundle exec bacon -Itest -q -a" + system "rake spec" puts true end def run_spec(path) if File.exists?(path) - @success &&= system "bundle exec bacon -Itest -q #{path}" + cmd = "bundle exec bacon -Ispec -q #{path}" + puts cmd + @success &&= system cmd puts end end @@ -33,32 +35,32 @@ module ::Guard end guard 'bacon' do - def deduce_test_from(token) - "test/test_#{token}.rb" + def deduce_spec_from(token) + "spec/#{token}_spec.rb" end Dir['lib/pry/*.rb'].each do |rb| rb[%r(lib/pry/(.+)\.rb$)] - test_rb = deduce_test_from $1 - if File.exists?(test_rb) - watch(rb) { test_rb } + spec_rb = deduce_spec_from $1 + if File.exists?(spec_rb) + watch(rb) { spec_rb } else exempt = %w( commands version - ).map {|token| deduce_test_from token} - puts 'Missing ' + test_rb if - ENV['WANT_TEST_COMPLAINTS'] and not exempt.include?(test_rb) + ).map {|token| deduce_spec_from token} + puts 'Missing ' + spec_rb if + ENV['WANT_SPEC_COMPLAINTS'] and not exempt.include?(spec_rb) end end - watch(%r{^lib/pry/commands/([^.]+)\.rb}) { |m| "test/test_commands/test_#{m[1]}.rb" } + watch(%r{^lib/pry/commands/([^.]+)\.rb}) { |m| "spec/commands/#{m[1]}_spec.rb" } # If no such mapping exists, just run all of them watch(%r{^lib/}) { :all } - # If we modified one test file, run it - watch(%r{^test.*/test_.+\.rb$}) + # If we modified one spec file, run it + watch(%r{^spec/.+\.rb$}) end # vim:ft=ruby @@ -18,7 +18,7 @@ def apply_spec_defaults(s) s.homepage = 'http://pry.github.com' s.executables = ['pry'] s.files = `git ls-files`.split("\n") - s.test_files = `git ls-files -- test/*`.split("\n") + s.test_files = `git ls-files -- spec/*`.split("\n") s.add_dependency('coderay', '~> 1.0.5') s.add_dependency('slop', ['~> 3.3.1']) s.add_dependency('method_source','~> 0.8') @@ -47,8 +47,11 @@ task :default => [:test] desc "Run tests" task :test do check_dependencies unless ENV['SKIP_DEP_CHECK'] - sh "bacon -Itest -rubygems -a -q" + all_specs = Dir['spec/**/*_spec.rb'] + all_specs.shuffle! if all_specs.respond_to? :shuffle! + sh "bacon -Ispec -rubygems -a -q #{all_specs.join ' '}" end +task :spec => :test desc "Run pry" task :pry do diff --git a/test/candidate_helper1.rb b/spec/candidate_helper1.rb index 46056a5e..46056a5e 100644 --- a/test/candidate_helper1.rb +++ b/spec/candidate_helper1.rb diff --git a/test/candidate_helper2.rb b/spec/candidate_helper2.rb index ebc22a9c..ebc22a9c 100644 --- a/test/candidate_helper2.rb +++ b/spec/candidate_helper2.rb diff --git a/test/test_cli.rb b/spec/cli_spec.rb index cb30eb5e..cb30eb5e 100644 --- a/test/test_cli.rb +++ b/spec/cli_spec.rb diff --git a/test/test_code.rb b/spec/code_spec.rb index 31c928e2..520df34d 100644 --- a/test/test_code.rb +++ b/spec/code_spec.rb @@ -36,13 +36,13 @@ describe Pry::Code do end should 'check for files relative to origin pwd' do - Dir.chdir('test') do |f| - Pry::Code.from_file('test/' + File.basename(__FILE__)).code_type.should == :ruby + Dir.chdir('spec') do |f| + Pry::Code.from_file('spec/' + File.basename(__FILE__)).code_type.should == :ruby end end should 'find files that are relative to the current working directory' do - Dir.chdir('test') do |f| + Dir.chdir('spec') do |f| Pry::Code.from_file(File.basename(__FILE__)).code_type.should == :ruby end end diff --git a/test/test_command_helpers.rb b/spec/command_helpers_spec.rb index 883f863c..883f863c 100644 --- a/test/test_command_helpers.rb +++ b/spec/command_helpers_spec.rb diff --git a/test/test_command_integration.rb b/spec/command_integration_spec.rb index 5fba8c10..5fba8c10 100644 --- a/test/test_command_integration.rb +++ b/spec/command_integration_spec.rb diff --git a/test/test_command_set.rb b/spec/command_set_spec.rb index 15fd7be8..15fd7be8 100644 --- a/test/test_command_set.rb +++ b/spec/command_set_spec.rb diff --git a/test/test_command.rb b/spec/command_spec.rb index 7c037e74..7c037e74 100644 --- a/test/test_command.rb +++ b/spec/command_spec.rb diff --git a/test/test_commands/test_amend_line.rb b/spec/commands/amend_line_spec.rb index 86526137..86526137 100644 --- a/test/test_commands/test_amend_line.rb +++ b/spec/commands/amend_line_spec.rb diff --git a/test/test_commands/test_bang.rb b/spec/commands/bang_spec.rb index 6200db37..6200db37 100644 --- a/test/test_commands/test_bang.rb +++ b/spec/commands/bang_spec.rb diff --git a/test/test_commands/test_cat.rb b/spec/commands/cat_spec.rb index 217754b4..217754b4 100644 --- a/test/test_commands/test_cat.rb +++ b/spec/commands/cat_spec.rb diff --git a/test/test_commands/test_cd.rb b/spec/commands/cd_spec.rb index c4a0d716..c4a0d716 100644 --- a/test/test_commands/test_cd.rb +++ b/spec/commands/cd_spec.rb diff --git a/test/test_commands/test_disable_pry.rb b/spec/commands/disable_pry_spec.rb index b458ec65..b458ec65 100644 --- a/test/test_commands/test_disable_pry.rb +++ b/spec/commands/disable_pry_spec.rb diff --git a/test/test_commands/test_edit_method.rb b/spec/commands/edit_method_spec.rb index d8333b59..d8333b59 100644 --- a/test/test_commands/test_edit_method.rb +++ b/spec/commands/edit_method_spec.rb diff --git a/test/test_commands/test_edit.rb b/spec/commands/edit_spec.rb index 874ae7d1..874ae7d1 100644 --- a/test/test_commands/test_edit.rb +++ b/spec/commands/edit_spec.rb diff --git a/test/test_commands/example.erb b/spec/commands/example.erb index 43c2efd2..43c2efd2 100644 --- a/test/test_commands/example.erb +++ b/spec/commands/example.erb diff --git a/test/test_commands/test_exit_all.rb b/spec/commands/exit_all_spec.rb index f97fa8b3..f97fa8b3 100644 --- a/test/test_commands/test_exit_all.rb +++ b/spec/commands/exit_all_spec.rb diff --git a/test/test_commands/test_exit_program.rb b/spec/commands/exit_program_spec.rb index eed447cb..eed447cb 100644 --- a/test/test_commands/test_exit_program.rb +++ b/spec/commands/exit_program_spec.rb diff --git a/test/test_commands/test_exit.rb b/spec/commands/exit_spec.rb index 6e902a8a..6e902a8a 100644 --- a/test/test_commands/test_exit.rb +++ b/spec/commands/exit_spec.rb diff --git a/test/test_commands/test_find_method.rb b/spec/commands/find_method_spec.rb index 78ee5a78..78ee5a78 100644 --- a/test/test_commands/test_find_method.rb +++ b/spec/commands/find_method_spec.rb diff --git a/test/test_commands/test_gem_list.rb b/spec/commands/gem_list_spec.rb index 7f7c2510..7f7c2510 100644 --- a/test/test_commands/test_gem_list.rb +++ b/spec/commands/gem_list_spec.rb diff --git a/test/test_commands/test_help.rb b/spec/commands/help_spec.rb index 16b975e2..16b975e2 100644 --- a/test/test_commands/test_help.rb +++ b/spec/commands/help_spec.rb diff --git a/test/test_commands/test_hist.rb b/spec/commands/hist_spec.rb index 934cbd79..934cbd79 100644 --- a/test/test_commands/test_hist.rb +++ b/spec/commands/hist_spec.rb diff --git a/test/test_commands/test_jump_to.rb b/spec/commands/jump_to_spec.rb index b90f1fea..b90f1fea 100644 --- a/test/test_commands/test_jump_to.rb +++ b/spec/commands/jump_to_spec.rb diff --git a/test/test_commands/test_ls.rb b/spec/commands/ls_spec.rb index a4178de4..a4178de4 100644 --- a/test/test_commands/test_ls.rb +++ b/spec/commands/ls_spec.rb diff --git a/test/test_commands/test_play.rb b/spec/commands/play_spec.rb index 3f65ff32..3f65ff32 100644 --- a/test/test_commands/test_play.rb +++ b/spec/commands/play_spec.rb diff --git a/test/test_commands/test_raise_up.rb b/spec/commands/raise_up_spec.rb index 8dc3f59b..8dc3f59b 100644 --- a/test/test_commands/test_raise_up.rb +++ b/spec/commands/raise_up_spec.rb diff --git a/test/test_commands/test_save_file.rb b/spec/commands/save_file_spec.rb index 381cf2a6..381cf2a6 100644 --- a/test/test_commands/test_save_file.rb +++ b/spec/commands/save_file_spec.rb diff --git a/test/test_commands/test_show_doc.rb b/spec/commands/show_doc_spec.rb index 6ce624fe..6ce624fe 100644 --- a/test/test_commands/test_show_doc.rb +++ b/spec/commands/show_doc_spec.rb diff --git a/test/test_commands/test_show_input.rb b/spec/commands/show_input_spec.rb index bf10bf5b..bf10bf5b 100644 --- a/test/test_commands/test_show_input.rb +++ b/spec/commands/show_input_spec.rb diff --git a/test/test_commands/test_show_source.rb b/spec/commands/show_source_spec.rb index ed831fd2..ed831fd2 100644 --- a/test/test_commands/test_show_source.rb +++ b/spec/commands/show_source_spec.rb diff --git a/test/test_commands/test_whereami.rb b/spec/commands/whereami_spec.rb index 03557d02..378e72ec 100644 --- a/test/test_commands/test_whereami.rb +++ b/spec/commands/whereami_spec.rb @@ -56,7 +56,7 @@ describe "whereami" do it 'should show description and correct code when __LINE__ and __FILE__ are outside @method.source_location' do class Cor def blimey! - eval <<-END, binding, "test/test_commands/example.erb", 1 + eval <<-END, binding, "spec/cmd/example.erb", 1 pry_eval(binding, 'whereami') END end @@ -70,7 +70,7 @@ describe "whereami" do it 'should show description and correct code when @method.source_location would raise an error' do class Cor - eval <<-END, binding, "test/test_commands/example.erb", 1 + eval <<-END, binding, "spec/cmd/example.erb", 1 def blimey! pry_eval(binding, 'whereami') end diff --git a/test/test_completion.rb b/spec/completion_spec.rb index 39a933a0..39a933a0 100644 --- a/test/test_completion.rb +++ b/spec/completion_spec.rb diff --git a/test/test_control_d_handler.rb b/spec/control_d_handler_spec.rb index 51a38d6d..51a38d6d 100644 --- a/test/test_control_d_handler.rb +++ b/spec/control_d_handler_spec.rb diff --git a/test/example_nesting.rb b/spec/example_nesting.rb index 06c90507..06c90507 100644 --- a/test/example_nesting.rb +++ b/spec/example_nesting.rb diff --git a/test/test_exception_whitelist.rb b/spec/exception_whitelist_spec.rb index f3d8329c..f3d8329c 100644 --- a/test/test_exception_whitelist.rb +++ b/spec/exception_whitelist_spec.rb diff --git a/test/helper.rb b/spec/helper.rb index 7236b3b7..7236b3b7 100644 --- a/test/helper.rb +++ b/spec/helper.rb diff --git a/test/test_history_array.rb b/spec/history_array_spec.rb index f1bd07aa..f1bd07aa 100644 --- a/test/test_history_array.rb +++ b/spec/history_array_spec.rb diff --git a/test/test_hooks.rb b/spec/hooks_spec.rb index 5a25951e..5a25951e 100644 --- a/test/test_hooks.rb +++ b/spec/hooks_spec.rb diff --git a/test/test_indent.rb b/spec/indent_spec.rb index bcc2ed53..28de8110 100644 --- a/test/test_indent.rb +++ b/spec/indent_spec.rb @@ -276,7 +276,7 @@ OUTPUT end describe "nesting" do - test = File.read("test/example_nesting.rb") + test = File.read("spec/example_nesting.rb") test.lines.each_with_index do |line, i| result = line.split("#").last.strip diff --git a/test/test_input_stack.rb b/spec/input_stack_spec.rb index 6d94bce9..6d94bce9 100644 --- a/test/test_input_stack.rb +++ b/spec/input_stack_spec.rb diff --git a/test/test_method.rb b/spec/method_spec.rb index 34af0714..34af0714 100644 --- a/test/test_method.rb +++ b/spec/method_spec.rb diff --git a/test/test_prompt.rb b/spec/prompt_spec.rb index 820b3616..820b3616 100644 --- a/test/test_prompt.rb +++ b/spec/prompt_spec.rb diff --git a/test/test_pry_defaults.rb b/spec/pry_defaults_spec.rb index e79706fa..e79706fa 100644 --- a/test/test_pry_defaults.rb +++ b/spec/pry_defaults_spec.rb diff --git a/test/test_pry_history.rb b/spec/pry_history_spec.rb index 15efe495..15efe495 100644 --- a/test/test_pry_history.rb +++ b/spec/pry_history_spec.rb diff --git a/test/test_pry_output.rb b/spec/pry_output_spec.rb index f672352c..f672352c 100644 --- a/test/test_pry_output.rb +++ b/spec/pry_output_spec.rb diff --git a/test/test_pry.rb b/spec/pry_spec.rb index aee20530..aee20530 100644 --- a/test/test_pry.rb +++ b/spec/pry_spec.rb diff --git a/test/test_sticky_locals.rb b/spec/sticky_locals_spec.rb index b80881b9..b80881b9 100644 --- a/test/test_sticky_locals.rb +++ b/spec/sticky_locals_spec.rb diff --git a/test/test_syntax_checking.rb b/spec/syntax_checking_spec.rb index 1df51484..1df51484 100644 --- a/test/test_syntax_checking.rb +++ b/spec/syntax_checking_spec.rb diff --git a/test/testrc b/spec/testrc index c1045c0e..c1045c0e 100644 --- a/test/testrc +++ b/spec/testrc diff --git a/test/testrcbad b/spec/testrcbad index fad9f732..fad9f732 100644 --- a/test/testrcbad +++ b/spec/testrcbad diff --git a/test/test_wrapped_module.rb b/spec/wrapped_module_spec.rb index 9814a50c..9814a50c 100644 --- a/test/test_wrapped_module.rb +++ b/spec/wrapped_module_spec.rb |