single_test 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +10 -10
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/single_test.rb +2 -2
- data/single_test.gemspec +7 -11
- data/spec/single_test_spec.rb +18 -15
- data/spec/spec_helper.rb +9 -7
- metadata +40 -23
data/Gemfile.lock
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
diff-lcs (1.1.
|
4
|
+
diff-lcs (1.1.3)
|
5
5
|
git (1.2.5)
|
6
|
-
jeweler (1.
|
7
|
-
bundler (~> 1.0
|
6
|
+
jeweler (1.6.4)
|
7
|
+
bundler (~> 1.0)
|
8
8
|
git (>= 1.2.5)
|
9
9
|
rake
|
10
10
|
rake (0.9.2.2)
|
11
|
-
rspec (2.
|
12
|
-
rspec-core (~> 2.
|
13
|
-
rspec-expectations (~> 2.
|
14
|
-
rspec-mocks (~> 2.
|
15
|
-
rspec-core (2.
|
16
|
-
rspec-expectations (2.
|
11
|
+
rspec (2.7.0)
|
12
|
+
rspec-core (~> 2.7.0)
|
13
|
+
rspec-expectations (~> 2.7.0)
|
14
|
+
rspec-mocks (~> 2.7.0)
|
15
|
+
rspec-core (2.7.1)
|
16
|
+
rspec-expectations (2.7.0)
|
17
17
|
diff-lcs (~> 1.1.2)
|
18
|
-
rspec-mocks (2.
|
18
|
+
rspec-mocks (2.7.0)
|
19
19
|
|
20
20
|
PLATFORMS
|
21
21
|
ruby
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.4
|
data/lib/single_test.rb
CHANGED
@@ -50,8 +50,8 @@ module SingleTest
|
|
50
50
|
def parse_cli(call)
|
51
51
|
raise "you should not have gotten here..." unless call =~ CMD_LINE_MATCHER
|
52
52
|
|
53
|
-
# replace any ::
|
54
|
-
call.gsub
|
53
|
+
# replace any :: with / for class names
|
54
|
+
call = call.gsub /::/, '/'
|
55
55
|
|
56
56
|
arguments = call.split(":",3)
|
57
57
|
[
|
data/single_test.gemspec
CHANGED
@@ -4,13 +4,13 @@
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version = "0.4.
|
7
|
+
s.name = %q{single_test}
|
8
|
+
s.version = "0.4.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Michael Grosser"]
|
12
|
-
s.date =
|
13
|
-
s.email =
|
12
|
+
s.date = %q{2011-12-11}
|
13
|
+
s.email = %q{grosser.michael@gmail.com}
|
14
14
|
s.files = [
|
15
15
|
"Gemfile",
|
16
16
|
"Gemfile.lock",
|
@@ -24,14 +24,10 @@ Gem::Specification.new do |s|
|
|
24
24
|
"spec/single_test_spec.rb",
|
25
25
|
"spec/spec_helper.rb"
|
26
26
|
]
|
27
|
-
s.homepage =
|
27
|
+
s.homepage = %q{http://github.com/grosser/single_test}
|
28
28
|
s.require_paths = ["lib"]
|
29
|
-
s.rubygems_version =
|
30
|
-
s.summary =
|
31
|
-
s.test_files = [
|
32
|
-
"spec/single_test_spec.rb",
|
33
|
-
"spec/spec_helper.rb"
|
34
|
-
]
|
29
|
+
s.rubygems_version = %q{1.6.2}
|
30
|
+
s.summary = %q{Rake tasks to invoke single tests/specs with rakish syntax}
|
35
31
|
|
36
32
|
if s.respond_to? :specification_version then
|
37
33
|
s.specification_version = 3
|
data/spec/single_test_spec.rb
CHANGED
@@ -1,62 +1,65 @@
|
|
1
1
|
require "spec_helper"
|
2
|
-
require 'single_test'
|
3
2
|
|
4
3
|
describe SingleTest do
|
5
4
|
describe :parse_cli do
|
5
|
+
def parse_cli(string)
|
6
|
+
SingleTest.parse_cli(string.freeze)
|
7
|
+
end
|
8
|
+
|
6
9
|
it "finds the type spec" do
|
7
|
-
|
10
|
+
parse_cli('spec:something')[0].should == 'spec'
|
8
11
|
end
|
9
12
|
|
10
13
|
it "finds the type test" do
|
11
|
-
|
14
|
+
parse_cli('test:something:else')[0].should == 'test'
|
12
15
|
end
|
13
16
|
|
14
17
|
it "does not find another type" do
|
15
|
-
lambda{
|
18
|
+
lambda{ parse_cli('oops:something:else') }.should raise_error
|
16
19
|
end
|
17
20
|
|
18
21
|
it "parses the file name" do
|
19
|
-
|
22
|
+
parse_cli('test:something:else')[1].should == 'something'
|
20
23
|
end
|
21
24
|
|
22
25
|
it "parses the test name" do
|
23
|
-
|
26
|
+
parse_cli('test:something:else')[2].should == 'else'
|
24
27
|
end
|
25
28
|
|
26
29
|
it "parses missing test name as nil" do
|
27
|
-
|
30
|
+
parse_cli('test:something')[2].should be_nil
|
28
31
|
end
|
29
32
|
|
30
33
|
it "parses empty test name as nil" do
|
31
|
-
|
34
|
+
parse_cli('test:something: ')[2].should be_nil
|
32
35
|
end
|
33
36
|
|
34
37
|
it "does not split test name further" do
|
35
|
-
|
38
|
+
parse_cli('test:something:else:oh:no')[2].should == 'else:oh:no'
|
36
39
|
end
|
37
40
|
|
38
41
|
it "parses ClassNames" do
|
39
|
-
|
42
|
+
parse_cli('test:ClassNames')[1].should == 'class_names'
|
40
43
|
end
|
41
44
|
|
42
45
|
it "parses ClassNames::WithNamespaces" do
|
43
|
-
|
46
|
+
parse_cli('test:ClassNames::WithNamespaces')[1].should == 'class_names/with_namespaces'
|
44
47
|
end
|
45
48
|
|
46
49
|
it "doesn't confuse :s with ::s" do
|
47
|
-
parsed =
|
50
|
+
parsed = parse_cli('test:ClassNames::WithNamespaces:foobar')
|
48
51
|
parsed[0].should == 'test'
|
49
52
|
parsed[1].should == 'class_names/with_namespaces'
|
50
53
|
parsed[2].should == 'foobar'
|
51
54
|
end
|
52
55
|
|
53
56
|
it "doesn't mess with non-class names" do
|
54
|
-
parsed =
|
57
|
+
parsed = parse_cli('test:ClassNames::WithNamespaces:FOOBAR')
|
55
58
|
parsed[2].should == 'FOOBAR'
|
56
59
|
end
|
57
60
|
|
58
61
|
it "doesn't mess with mixed case filenames" do
|
59
|
-
parsed =
|
62
|
+
parsed = parse_cli('test:a/fileName/withMixedCase')
|
60
63
|
parsed[1].should == 'a/fileName/withMixedCase'
|
61
64
|
end
|
62
65
|
end
|
@@ -133,7 +136,7 @@ describe SingleTest do
|
|
133
136
|
end
|
134
137
|
|
135
138
|
it "runs another file when timestamps change" do
|
136
|
-
`touch -t 12312359
|
139
|
+
`touch -t 12312359 app/yyy.rb` # last minute in current year, spec will fail on new years eve :D
|
137
140
|
SingleTest.should_receive(:run_test).with(:spec, "spec/yyy_spec.rb")
|
138
141
|
SingleTest.run_last(:spec)
|
139
142
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,16 +1,18 @@
|
|
1
|
-
# ---- requirements
|
2
1
|
SPEC_ROOT = File.dirname(__FILE__)
|
3
2
|
$LOAD_PATH << File.expand_path("../lib", SPEC_ROOT)
|
3
|
+
require "single_test"
|
4
|
+
|
5
|
+
Dir.chdir(SPEC_ROOT)
|
4
6
|
|
5
|
-
# ---- rspec
|
6
7
|
RSpec.configure do |config|
|
7
8
|
config.before do
|
8
|
-
`mkdir -p
|
9
|
-
`touch
|
9
|
+
`mkdir -p script`
|
10
|
+
`touch script/spec`
|
10
11
|
end
|
12
|
+
|
11
13
|
config.after do
|
12
|
-
`rm -rf
|
13
|
-
`rm -rf
|
14
|
-
`rm -rf
|
14
|
+
`rm -rf script`
|
15
|
+
`rm -rf app`
|
16
|
+
`rm -rf spec`
|
15
17
|
end
|
16
18
|
end
|
metadata
CHANGED
@@ -1,22 +1,33 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: single_test
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 4
|
9
|
+
- 4
|
10
|
+
version: 0.4.4
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Michael Grosser
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
17
|
+
|
18
|
+
date: 2011-12-11 00:00:00 -08:00
|
19
|
+
default_executable:
|
13
20
|
dependencies: []
|
21
|
+
|
14
22
|
description:
|
15
23
|
email: grosser.michael@gmail.com
|
16
24
|
executables: []
|
25
|
+
|
17
26
|
extensions: []
|
27
|
+
|
18
28
|
extra_rdoc_files: []
|
19
|
-
|
29
|
+
|
30
|
+
files:
|
20
31
|
- Gemfile
|
21
32
|
- Gemfile.lock
|
22
33
|
- Rakefile
|
@@ -28,33 +39,39 @@ files:
|
|
28
39
|
- spec/example_finder_test.txt
|
29
40
|
- spec/single_test_spec.rb
|
30
41
|
- spec/spec_helper.rb
|
42
|
+
has_rdoc: true
|
31
43
|
homepage: http://github.com/grosser/single_test
|
32
44
|
licenses: []
|
45
|
+
|
33
46
|
post_install_message:
|
34
47
|
rdoc_options: []
|
35
|
-
|
48
|
+
|
49
|
+
require_paths:
|
36
50
|
- lib
|
37
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
51
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
38
52
|
none: false
|
39
|
-
requirements:
|
40
|
-
- -
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
|
43
|
-
segments:
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
hash: 3
|
57
|
+
segments:
|
44
58
|
- 0
|
45
|
-
|
46
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
|
+
version: "0"
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
47
61
|
none: false
|
48
|
-
requirements:
|
49
|
-
- -
|
50
|
-
- !ruby/object:Gem::Version
|
51
|
-
|
62
|
+
requirements:
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
hash: 3
|
66
|
+
segments:
|
67
|
+
- 0
|
68
|
+
version: "0"
|
52
69
|
requirements: []
|
70
|
+
|
53
71
|
rubyforge_project:
|
54
|
-
rubygems_version: 1.
|
72
|
+
rubygems_version: 1.6.2
|
55
73
|
signing_key:
|
56
74
|
specification_version: 3
|
57
75
|
summary: Rake tasks to invoke single tests/specs with rakish syntax
|
58
|
-
test_files:
|
59
|
-
|
60
|
-
- spec/spec_helper.rb
|
76
|
+
test_files: []
|
77
|
+
|