single_test 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/lib/single_test.rb +11 -6
- data/single_test.gemspec +7 -7
- data/spec/single_test_spec.rb +10 -0
- metadata +21 -39
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.3
|
data/lib/single_test.rb
CHANGED
@@ -49,10 +49,14 @@ module SingleTest
|
|
49
49
|
# spec:user:blah --> [spec,user,blah]
|
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 ::s with /s for class names
|
54
|
+
call.gsub! /::/, '/'
|
55
|
+
|
56
|
+
arguments = call.split(":",3)
|
53
57
|
[
|
54
58
|
arguments[0], #type
|
55
|
-
arguments[1], #file name
|
59
|
+
class_to_filename(arguments[1]), # class or file name
|
56
60
|
arguments[2].to_s.strip.empty? ? nil : arguments[2] #test name
|
57
61
|
]
|
58
62
|
end
|
@@ -109,10 +113,11 @@ module SingleTest
|
|
109
113
|
|
110
114
|
private
|
111
115
|
|
112
|
-
#
|
113
|
-
def
|
114
|
-
word =
|
115
|
-
word.
|
116
|
+
# converted from underscore to do a few more checks
|
117
|
+
def class_to_filename(suspect)
|
118
|
+
word = suspect.to_s.dup
|
119
|
+
return word unless word.match /^[A-Z]/ and not word.match %r{/[a-z]}
|
120
|
+
|
116
121
|
word.gsub!(/([A-Z]+)([A-Z][a-z])/,'\1_\2')
|
117
122
|
word.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
|
118
123
|
word.tr!("-", "_")
|
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 = "single_test"
|
8
|
+
s.version = "0.4.3"
|
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 = "2011-10-23"
|
13
|
+
s.email = "grosser.michael@gmail.com"
|
14
14
|
s.files = [
|
15
15
|
"Gemfile",
|
16
16
|
"Gemfile.lock",
|
@@ -24,10 +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 = "http://github.com/grosser/single_test"
|
28
28
|
s.require_paths = ["lib"]
|
29
|
-
s.rubygems_version =
|
30
|
-
s.summary =
|
29
|
+
s.rubygems_version = "1.8.10"
|
30
|
+
s.summary = "Rake tasks to invoke single tests/specs with rakish syntax"
|
31
31
|
s.test_files = [
|
32
32
|
"spec/single_test_spec.rb",
|
33
33
|
"spec/spec_helper.rb"
|
data/spec/single_test_spec.rb
CHANGED
@@ -49,6 +49,16 @@ describe SingleTest do
|
|
49
49
|
parsed[1].should == 'class_names/with_namespaces'
|
50
50
|
parsed[2].should == 'foobar'
|
51
51
|
end
|
52
|
+
|
53
|
+
it "doesn't mess with non-class names" do
|
54
|
+
parsed = SingleTest.parse_cli('test:ClassNames::WithNamespaces:FOOBAR')
|
55
|
+
parsed[2].should == 'FOOBAR'
|
56
|
+
end
|
57
|
+
|
58
|
+
it "doesn't mess with mixed case filenames" do
|
59
|
+
parsed = SingleTest.parse_cli('test:a/fileName/withMixedCase')
|
60
|
+
parsed[1].should == 'a/fileName/withMixedCase'
|
61
|
+
end
|
52
62
|
end
|
53
63
|
|
54
64
|
describe :find_test_file do
|
metadata
CHANGED
@@ -1,33 +1,22 @@
|
|
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
|
+
version: 0.4.3
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 4
|
9
|
-
- 2
|
10
|
-
version: 0.4.2
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Michael Grosser
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
date: 2011-10-13 00:00:00 +02:00
|
19
|
-
default_executable:
|
12
|
+
date: 2011-10-23 00:00:00.000000000 Z
|
20
13
|
dependencies: []
|
21
|
-
|
22
14
|
description:
|
23
15
|
email: grosser.michael@gmail.com
|
24
16
|
executables: []
|
25
|
-
|
26
17
|
extensions: []
|
27
|
-
|
28
18
|
extra_rdoc_files: []
|
29
|
-
|
30
|
-
files:
|
19
|
+
files:
|
31
20
|
- Gemfile
|
32
21
|
- Gemfile.lock
|
33
22
|
- Rakefile
|
@@ -39,40 +28,33 @@ files:
|
|
39
28
|
- spec/example_finder_test.txt
|
40
29
|
- spec/single_test_spec.rb
|
41
30
|
- spec/spec_helper.rb
|
42
|
-
has_rdoc: true
|
43
31
|
homepage: http://github.com/grosser/single_test
|
44
32
|
licenses: []
|
45
|
-
|
46
33
|
post_install_message:
|
47
34
|
rdoc_options: []
|
48
|
-
|
49
|
-
require_paths:
|
35
|
+
require_paths:
|
50
36
|
- lib
|
51
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
37
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
52
38
|
none: false
|
53
|
-
requirements:
|
54
|
-
- -
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
|
57
|
-
segments:
|
39
|
+
requirements:
|
40
|
+
- - ! '>='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
segments:
|
58
44
|
- 0
|
59
|
-
|
60
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
45
|
+
hash: -221565731
|
46
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
47
|
none: false
|
62
|
-
requirements:
|
63
|
-
- -
|
64
|
-
- !ruby/object:Gem::Version
|
65
|
-
|
66
|
-
segments:
|
67
|
-
- 0
|
68
|
-
version: "0"
|
48
|
+
requirements:
|
49
|
+
- - ! '>='
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '0'
|
69
52
|
requirements: []
|
70
|
-
|
71
53
|
rubyforge_project:
|
72
|
-
rubygems_version: 1.
|
54
|
+
rubygems_version: 1.8.10
|
73
55
|
signing_key:
|
74
56
|
specification_version: 3
|
75
57
|
summary: Rake tasks to invoke single tests/specs with rakish syntax
|
76
|
-
test_files:
|
58
|
+
test_files:
|
77
59
|
- spec/single_test_spec.rb
|
78
60
|
- spec/spec_helper.rb
|