test_launcher 2.20.0 → 2.21.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/test_launcher/frameworks/minitest.rb +7 -2
- data/lib/test_launcher/search/git.rb +2 -1
- data/lib/test_launcher/version.rb +1 -1
- data/test_launcher.gemspec +1 -1
- metadata +3 -60
- data/.gitignore +0 -16
- data/Gemfile +0 -8
- data/README.md +0 -419
- data/Rakefile +0 -9
- data/test/install +0 -3
- data/test/test_helper.rb +0 -65
- data/test/test_helpers/integration_helper.rb +0 -33
- data/test/test_helpers/mock.rb +0 -59
- data/test/test_helpers/mock_searcher.rb +0 -1
- data/test/test_helpers/mocks.rb +0 -77
- data/test/test_helpers/mocks/searcher_mock.rb +0 -84
- data/test/test_launcher/cli/input_parser_test.rb +0 -79
- data/test/test_launcher/ex_unit_integration_test.rb +0 -413
- data/test/test_launcher/frameworks/implementation/test_case_test.rb +0 -73
- data/test/test_launcher/frameworks/minitest/runner_test.rb +0 -76
- data/test/test_launcher/frameworks/minitest/searcher_test.rb +0 -109
- data/test/test_launcher/frameworks/rspec/runner_test.rb +0 -83
- data/test/test_launcher/frameworks/rspec/searcher_test.rb +0 -54
- data/test/test_launcher/generic_integration_test.rb +0 -62
- data/test/test_launcher/minitest_integration_test.rb +0 -683
- data/test/test_launcher/queries/example_name_query_test.rb +0 -221
- data/test/test_launcher/queries/full_regex_query_test.rb +0 -153
- data/test/test_launcher/queries/generic_query_test.rb +0 -23
- data/test/test_launcher/queries/line_number_query_test.rb +0 -107
- data/test/test_launcher/queries/multi_path_query_test.rb +0 -126
- data/test/test_launcher/queries/path_query_test.rb +0 -192
- data/test/test_launcher/rspec_integration_test.rb +0 -574
- data/test/test_launcher/rubymine_test.rb +0 -65
- data/test/test_launcher/search/ag_test.rb +0 -42
- data/test/test_launcher/search/git_test.rb +0 -41
@@ -1,65 +0,0 @@
|
|
1
|
-
require "test_helper"
|
2
|
-
require "test_launcher/rubymine/launcher"
|
3
|
-
require "test_launcher/rubymine/request"
|
4
|
-
|
5
|
-
module TestLauncher
|
6
|
-
class RubymineTest < TestCase
|
7
|
-
def test_launch__run__file
|
8
|
-
args = "/Users/username/some_app/bin/spring testunit /Users/username/some_app/engines/some_engine/test/does_something_test.rb"
|
9
|
-
expected_command = "cd /Users/username/some_app/engines/some_engine && bundle exec ruby -I test -e 'ARGV.each {|f| require(f)}' /Users/username/some_app/engines/some_engine/test/does_something_test.rb"
|
10
|
-
|
11
|
-
assert_executes expected_command, args
|
12
|
-
end
|
13
|
-
|
14
|
-
def test_launch__run__example__spring
|
15
|
-
args = "/Users/username/some_app/bin/spring testunit /Users/username/some_app/engines/some_engine/test/does_something_test.rb --name=some_test_name"
|
16
|
-
expected_command = "cd /Users/username/some_app/engines/some_engine && bundle exec ruby -I test /Users/username/some_app/engines/some_engine/test/does_something_test.rb --name='some_test_name'"
|
17
|
-
|
18
|
-
assert_executes expected_command, args
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_launch__run__example__no_spring
|
22
|
-
args = "/Users/username/some_app/engines/some_engine/test/does_something_test.rb --name=some_test_name"
|
23
|
-
expected_command = "cd /Users/username/some_app/engines/some_engine && bundle exec ruby -I test /Users/username/some_app/engines/some_engine/test/does_something_test.rb --name='some_test_name'"
|
24
|
-
|
25
|
-
assert_executes expected_command, args
|
26
|
-
end
|
27
|
-
|
28
|
-
def test_launch__run__example__no_spring__no_disable_spring
|
29
|
-
args = "/Users/username/some_app/engines/some_engine/test/does_something_test.rb --name=some_test_name"
|
30
|
-
expected_command = "cd /Users/username/some_app/engines/some_engine && bundle exec ruby -I test /Users/username/some_app/engines/some_engine/test/does_something_test.rb --name='some_test_name'"
|
31
|
-
|
32
|
-
assert_executes expected_command, args, disable_spring: false
|
33
|
-
end
|
34
|
-
|
35
|
-
def test_launch__debug__example
|
36
|
-
args = "/Users/username/.rvm/gems/ruby-2.2.3/gems/ruby-debug-ide-0.6.1.beta2/bin/rdebug-ide --disable-int-handler --evaluation-timeout 10 --rubymine-protocol-extensions --port 58930 --host 0.0.0.0 --dispatcher-port 58931 -- /Users/username/some_app/bin/spring testunit /Users/username/some_app/engines/some_engine/test/does_something_test.rb --name=some_test_name"
|
37
|
-
expected_command = "cd /Users/username/some_app/engines/some_engine && bundle exec ruby -I test /Users/username/.rvm/gems/ruby-2.2.3/gems/ruby-debug-ide-0.6.1.beta2/bin/rdebug-ide --disable-int-handler --evaluation-timeout 10 --rubymine-protocol-extensions --port 58930 --host 0.0.0.0 --dispatcher-port 58931 -- /Users/username/some_app/bin/spring testunit /Users/username/some_app/engines/some_engine/test/does_something_test.rb --name=some_test_name"
|
38
|
-
|
39
|
-
assert_executes(expected_command, args)
|
40
|
-
end
|
41
|
-
|
42
|
-
def test_launch__debug__file
|
43
|
-
args = "/Users/username/.rvm/gems/ruby-2.2.3/gems/ruby-debug-ide-0.6.1.beta2/bin/rdebug-ide --disable-int-handler --evaluation-timeout 10 --rubymine-protocol-extensions --port 58930 --host 0.0.0.0 --dispatcher-port 58931 -- /Users/username/some_app/bin/spring testunit /Users/username/some_app/engines/some_engine/test/does_something_test.rb"
|
44
|
-
expected_command = "cd /Users/username/some_app/engines/some_engine && bundle exec ruby -I test /Users/username/.rvm/gems/ruby-2.2.3/gems/ruby-debug-ide-0.6.1.beta2/bin/rdebug-ide --disable-int-handler --evaluation-timeout 10 --rubymine-protocol-extensions --port 58930 --host 0.0.0.0 --dispatcher-port 58931 -- /Users/username/some_app/bin/spring testunit /Users/username/some_app/engines/some_engine/test/does_something_test.rb"
|
45
|
-
|
46
|
-
assert_executes(expected_command, args)
|
47
|
-
end
|
48
|
-
|
49
|
-
private
|
50
|
-
|
51
|
-
def assert_executes(expected_command, args, disable_spring: true)
|
52
|
-
request = Rubymine::Request.new(disable_spring: disable_spring)
|
53
|
-
|
54
|
-
launcher = Rubymine::Launcher.new(
|
55
|
-
args: args.split(" "),
|
56
|
-
shell: dummy_shell,
|
57
|
-
request: request
|
58
|
-
)
|
59
|
-
|
60
|
-
launcher.launch
|
61
|
-
assert_equal 1, dummy_shell.recall(:exec).size
|
62
|
-
assert_equal [[expected_command]], dummy_shell.recall(:exec)
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
require "test_helper"
|
2
|
-
require "test_launcher/search/ag"
|
3
|
-
require "test_helpers/mocks"
|
4
|
-
|
5
|
-
module TestLauncher
|
6
|
-
module Search
|
7
|
-
class AgTest < TestCase
|
8
|
-
include DefaultMocks
|
9
|
-
|
10
|
-
def setup
|
11
|
-
super
|
12
|
-
Dir.stubs(:chdir)
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_find_files__strips_absolute_path_for_search
|
16
|
-
interface = mock {
|
17
|
-
expects(:root_path).returns("/path/to/repo")
|
18
|
-
expects(:ls_files).with("relative/file_test.rb").returns(["inline_gem/relative/file_test.rb"])
|
19
|
-
}
|
20
|
-
|
21
|
-
searcher = Ag.new(nil, interface)
|
22
|
-
files = searcher.find_files("/path/to/repo/relative/file_test.rb")
|
23
|
-
|
24
|
-
assert_equal ["/path/to/repo/inline_gem/relative/file_test.rb"], files
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_grep__strips_absolute_path_of_file_pattern
|
28
|
-
interface = mock {
|
29
|
-
expects(:root_path).returns("/path/to/repo")
|
30
|
-
expects(:grep).with("regex", "relative/file_test.rb").returns([
|
31
|
-
"relative/file_test.rb:20: def test_regex"
|
32
|
-
])
|
33
|
-
}
|
34
|
-
|
35
|
-
searcher = Ag.new(nil, interface)
|
36
|
-
files = searcher.grep("regex", file_pattern: "/path/to/repo/relative/file_test.rb")
|
37
|
-
|
38
|
-
assert_equal [{file: "/path/to/repo/relative/file_test.rb", line_number: 20, line: "def test_regex"}], files
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
require "test_helper"
|
2
|
-
require "test_launcher/search/git"
|
3
|
-
require "test_helpers/mocks"
|
4
|
-
|
5
|
-
module TestLauncher
|
6
|
-
module Search
|
7
|
-
class GitTest < TestCase
|
8
|
-
include DefaultMocks
|
9
|
-
|
10
|
-
def setup
|
11
|
-
super
|
12
|
-
Dir.stubs(:chdir)
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_find_files__strips_absolute_path_for_search_and_replaces_it
|
16
|
-
interface = mock {
|
17
|
-
expects(:root_path).returns("/path/to/repo")
|
18
|
-
expects(:ls_files).with("relative/file_test.rb").returns(["inline_gem/relative/file_test.rb"])
|
19
|
-
}
|
20
|
-
|
21
|
-
searcher = Git.new(nil, interface)
|
22
|
-
files = searcher.find_files("/path/to/repo/relative/file_test.rb")
|
23
|
-
|
24
|
-
assert_equal ["/path/to/repo/inline_gem/relative/file_test.rb"], files
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_find_files__returns_file_if_exists
|
28
|
-
# git ls-files will not find newly created files
|
29
|
-
interface = mock {
|
30
|
-
expects(:root_path).returns("/path/to/repo")
|
31
|
-
}
|
32
|
-
|
33
|
-
File.stubs(:exist?).with('thing_test.rb').returns(true)
|
34
|
-
searcher = Git.new(nil, interface)
|
35
|
-
files = searcher.find_files("thing_test.rb")
|
36
|
-
|
37
|
-
assert_equal ['/path/to/repo/thing_test.rb'], files
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|