tdd 1.0.0 → 1.0.1
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/README.md +9 -2
- data/bin/tdd +28 -4
- data/lib/tdd/version.rb +1 -1
- metadata +64 -47
data/README.md
CHANGED
@@ -11,13 +11,20 @@ Yes.
|
|
11
11
|
Examples
|
12
12
|
--------
|
13
13
|
|
14
|
-
|
14
|
+
Use with test/unit:
|
15
15
|
|
16
16
|
$ tdd test/unit/some_unit_test.rb
|
17
17
|
|
18
|
-
|
18
|
+
Use with rspec:
|
19
19
|
|
20
20
|
$ tdd spec/some_spec.rb
|
21
|
+
# Run all specs
|
22
|
+
$ tdd spec
|
23
|
+
|
24
|
+
Use with rake:
|
25
|
+
|
26
|
+
$ tdd rake test:functional
|
27
|
+
$ tdd rake spec
|
21
28
|
|
22
29
|
You can pass arguments you would normally pass to `ruby -Itest` or `rspec`
|
23
30
|
|
data/bin/tdd
CHANGED
@@ -19,13 +19,20 @@ tdd watches files and runs test/unit or rspec tests when they change.
|
|
19
19
|
__
|
20
20
|
|
21
21
|
examples <<-__
|
22
|
-
|
22
|
+
Use with test/unit:
|
23
23
|
|
24
24
|
$ tdd test/unit/some_unit_test.rb
|
25
25
|
|
26
|
-
|
26
|
+
Use with rspec:
|
27
27
|
|
28
28
|
$ tdd spec/some_spec.rb
|
29
|
+
# Run all specs
|
30
|
+
$ tdd spec
|
31
|
+
|
32
|
+
Use with rake:
|
33
|
+
|
34
|
+
$ tdd rake test:functional
|
35
|
+
$ tdd rake spec
|
29
36
|
|
30
37
|
You can pass arguments you would normally pass to `ruby -Itest` or `rspec`
|
31
38
|
|
@@ -56,6 +63,7 @@ related to a functional or controller test:
|
|
56
63
|
|
57
64
|
will watch all view files in app/views/users, the users_controller and the
|
58
65
|
test file for changes.
|
66
|
+
|
59
67
|
__
|
60
68
|
|
61
69
|
def run
|
@@ -65,6 +73,10 @@ test file for changes.
|
|
65
73
|
end
|
66
74
|
|
67
75
|
def parse_the_command_line
|
76
|
+
if ARGV.empty?
|
77
|
+
puts usage['examples']
|
78
|
+
exit 1
|
79
|
+
end
|
68
80
|
|
69
81
|
pos = ARGV.index('--')
|
70
82
|
if pos
|
@@ -74,6 +86,7 @@ test file for changes.
|
|
74
86
|
@paths = %w[app lib config test spec]
|
75
87
|
@test_args = ARGV[0..-1].join(' ')
|
76
88
|
end
|
89
|
+
|
77
90
|
@test_file = @test_args.scan(/^.+.rb/).first
|
78
91
|
|
79
92
|
if @paths.first == "glob"
|
@@ -93,8 +106,19 @@ test file for changes.
|
|
93
106
|
@paths << @test_file
|
94
107
|
end
|
95
108
|
|
96
|
-
test_command = 'rspec' if @test_file.match(/_spec.rb/)
|
97
|
-
test_command = 'ruby -Itest' if @test_file.match(/_test.rb/)
|
109
|
+
test_command = 'rspec' if @test_args.match(/^spec$/) || @test_file && @test_file.match(/_spec.rb/)
|
110
|
+
test_command = 'ruby -Itest' if @test_file && @test_file.match(/_test.rb/)
|
111
|
+
if @test_args.match(/^rake/)
|
112
|
+
test_command = @test_args
|
113
|
+
@test_args = nil
|
114
|
+
end
|
115
|
+
|
116
|
+
if test_command.nil?
|
117
|
+
say("No test or spec command could be built.", :color => :red)
|
118
|
+
say("Pass -h option to see examples.", :color => :red)
|
119
|
+
exit 1
|
120
|
+
end
|
121
|
+
|
98
122
|
@command = "#{test_command} #{@test_args}"
|
99
123
|
|
100
124
|
@paths = %w[.] if @paths.empty?
|
data/lib/tdd/version.rb
CHANGED
metadata
CHANGED
@@ -1,56 +1,62 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: tdd
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Tyler Montgomery
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2013-01-10 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: main
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '5.0'
|
22
|
-
type: :runtime
|
23
22
|
prerelease: false
|
24
|
-
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '5.0'
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: rb-fsevent
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
33
24
|
none: false
|
34
|
-
requirements:
|
25
|
+
requirements:
|
35
26
|
- - ~>
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 31
|
29
|
+
segments:
|
30
|
+
- 5
|
31
|
+
- 0
|
32
|
+
version: "5.0"
|
38
33
|
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: rb-fsevent
|
39
37
|
prerelease: false
|
40
|
-
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
39
|
none: false
|
42
|
-
requirements:
|
40
|
+
requirements:
|
43
41
|
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 25
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
- 9
|
47
|
+
version: "0.9"
|
48
|
+
type: :runtime
|
49
|
+
version_requirements: *id002
|
46
50
|
description: Fire up that tdd loop
|
47
|
-
email:
|
51
|
+
email:
|
48
52
|
- tyler.a.montgomery@gmail.com
|
49
|
-
executables:
|
53
|
+
executables:
|
50
54
|
- tdd
|
51
55
|
extensions: []
|
56
|
+
|
52
57
|
extra_rdoc_files: []
|
53
|
-
|
58
|
+
|
59
|
+
files:
|
54
60
|
- .gitignore
|
55
61
|
- Gemfile
|
56
62
|
- LICENSE
|
@@ -60,28 +66,39 @@ files:
|
|
60
66
|
- lib/tdd.rb
|
61
67
|
- lib/tdd/version.rb
|
62
68
|
- tdd.gemspec
|
63
|
-
homepage:
|
69
|
+
homepage: ""
|
64
70
|
licenses: []
|
71
|
+
|
65
72
|
post_install_message:
|
66
73
|
rdoc_options: []
|
67
|
-
|
74
|
+
|
75
|
+
require_paths:
|
68
76
|
- lib
|
69
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
77
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
70
78
|
none: false
|
71
|
-
requirements:
|
72
|
-
- -
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
|
75
|
-
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
hash: 3
|
83
|
+
segments:
|
84
|
+
- 0
|
85
|
+
version: "0"
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
87
|
none: false
|
77
|
-
requirements:
|
78
|
-
- -
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
hash: 3
|
92
|
+
segments:
|
93
|
+
- 0
|
94
|
+
version: "0"
|
81
95
|
requirements: []
|
96
|
+
|
82
97
|
rubyforge_project:
|
83
|
-
rubygems_version: 1.8.
|
98
|
+
rubygems_version: 1.8.24
|
84
99
|
signing_key:
|
85
100
|
specification_version: 3
|
86
|
-
summary:
|
101
|
+
summary: ""
|
87
102
|
test_files: []
|
103
|
+
|
104
|
+
has_rdoc:
|