Permalink
Browse files

some fixes for edit key bindings

  • Loading branch information...
1 parent d04ad68 commit 2fd016a9970d7b1072fd5877f7311aa35aa0ebe0 Chris Nelson committed Mar 16, 2011
Showing with 1 addition and 51 deletions.
  1. +1 −0 plugins/help/lib/help/view_controller.rb
  2. +0 −51 plugins/key_bindings/spec/run_test_command_spec.rb
@@ -22,6 +22,7 @@ def index
end
def add_key_binding(key, command)
+ return unless key && key.length > 0
Redcar::KeyBindings.add_key_binding key, command
end
end
@@ -1,51 +0,0 @@
-require File.join(File.dirname(__FILE__), 'spec_helper')
-
-describe Redcar::RunTestCommand do
- describe "calling run_test" do
- before do
- storage_file = File.join(Redcar.user_dir, "storage", "test_runner.yaml")
- FileUtils.rm(storage_file) if File.exists?(storage_file)
- Redcar::RunTestCommand.class_eval { @storage = nil}
- @run_test_command = Redcar::RunTestCommand.new
- Redcar::Project::Manager.stub!(:focussed_project).and_return(mock("project", {:path => "foo"}))
- end
- describe "with a test_unit test" do
- before do
- @test_path = "foo/bar/foo_test.rb"
- end
- describe "with a line that doesn't match a pattern" do
- it "should run the test file" do
- Redcar::Runnables.should_receive(:run_process).with(
- "foo", "ruby -Itest #{@test_path}", "Running test: foo_test.rb")
- @run_test_command.run_test(@test_path, "whatever")
- end
- end
- describe "with a line that matches a pattern" do
- it "should run the test file" do
- Redcar::Runnables.should_receive(:run_process).with(
- "foo", "ruby -Itest #{@test_path} -n \"/this is a context/\"", "Running test: this is a context")
- @run_test_command.run_test(@test_path, %{context "this is a context"})
- end
- end
- end
- describe "with an rspec2 spec" do
- before do
- @test_path = "foo/bar/foo_spec.rb"
- end
- describe "with a line that doesn't match a pattern" do
- it "should run the test file" do
- Redcar::Runnables.should_receive(:run_process).with(
- "foo", "ruby -Ispec #{@test_path}", "Running test: foo_spec.rb")
- @run_test_command.run_test(@test_path, "whatever")
- end
- end
- describe "with a line that matches a pattern" do
- it "should run the test file" do
- Redcar::Runnables.should_receive(:run_process).with(
- "foo", %{ruby -Ispec #{@test_path} -e "this is a context"}, "Running test: this is a context")
- @run_test_command.run_test(@test_path, %{describe "this is a context"})
- end
- end
- end
- end
-end

0 comments on commit 2fd016a

Please sign in to comment.