keeptesting 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/bin/keeptesting +56 -15
- data/lib/keeptesting/browser_console.rb +8 -4
- data/lib/keeptesting/cli.rb +9 -4
- data/lib/keeptesting/version.rb +1 -1
- data/test/test_keeptesting.rb +0 -1
- data/todo.org +13 -18
- metadata +15 -15
data/README.md
CHANGED
data/bin/keeptesting
CHANGED
@@ -4,21 +4,68 @@ require "keeptesting"
|
|
4
4
|
require "optparse"
|
5
5
|
require 'fssm'
|
6
6
|
|
7
|
+
|
8
|
+
|
9
|
+
def usage
|
10
|
+
<<USAGE
|
11
|
+
|
12
|
+
Usage: keeptesting [options] 'FAILURE-MATCHING-REGEX' 'TEST-COMMAND'
|
13
|
+
|
14
|
+
Run tests whenever files change in the current directory or subdirectories.
|
15
|
+
|
16
|
+
Spits back indication of test success or failure, based on specified regex
|
17
|
+
that detects errors/failures in the output of a test run.
|
18
|
+
Starts embedded webserver by default, letting you see test feedback in browser
|
19
|
+
window. Can also run in the command line.
|
20
|
+
|
21
|
+
Note: Be sure to use quotes around params like the examples!
|
22
|
+
|
23
|
+
Examples:
|
24
|
+
|
25
|
+
keeptesting 'Error|Failure' 'rake test' (Run tests whenever anything changes)
|
26
|
+
keeptesting -p 'test' -p 'lib' -c 'Error|Failure' 'rake test' (Test on changes in test/ or lib/)
|
27
|
+
|
28
|
+
-c, --command-line-mode Commandline mode
|
29
|
+
-p, --watched-path Path to watch for changes
|
30
|
+
-h, --help Display usage
|
31
|
+
-v, --version Display version number
|
32
|
+
|
33
|
+
USAGE
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
|
7
38
|
def parse_options
|
8
39
|
options = {}
|
9
|
-
|
10
|
-
OptionParser.new do |o|
|
11
|
-
o.banner = "Usage: keeptesting [options] -f 'FAILURE-MATCHING-REGEX' -t 'TEST-COMMAND'\n\n"
|
12
40
|
|
13
|
-
|
14
|
-
|
41
|
+
ARGV.each do |arg|
|
42
|
+
if arg == "-v" || arg == "--version"
|
43
|
+
puts Keeptesting::VERSION; exit
|
44
|
+
elsif arg == "-h" || arg == "--help"
|
45
|
+
puts usage; exit
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
if ARGV.size < 2
|
50
|
+
puts usage; exit
|
51
|
+
end
|
15
52
|
|
16
|
-
|
53
|
+
options[:failure_regex] = ARGV[ARGV.size-2]
|
54
|
+
options[:test_command] = ARGV[ARGV.size-1]
|
55
|
+
|
56
|
+
ARGV.each_with_index do |arg, i|
|
57
|
+
if arg == "-c" || arg == "--command-line-mode"
|
58
|
+
options[:cli_mode] = true
|
59
|
+
end
|
17
60
|
|
18
|
-
|
19
|
-
|
61
|
+
if arg == "-p" || arg == "--watched-path"
|
62
|
+
options[:watched_paths] ||= []
|
63
|
+
options[:watched_paths] << ARGV[i+1]
|
64
|
+
end
|
65
|
+
end
|
20
66
|
|
21
|
-
|
67
|
+
if !options[:watched_paths]
|
68
|
+
options[:watched_paths] == ["**/*"]
|
22
69
|
end
|
23
70
|
|
24
71
|
return options
|
@@ -27,14 +74,8 @@ end
|
|
27
74
|
|
28
75
|
options = parse_options
|
29
76
|
|
30
|
-
if !options[:failure_regex] || !options[:test_command]
|
31
|
-
puts "ERROR: missing args!" # TODO do this in optionsparse step above
|
32
|
-
end
|
33
|
-
|
34
77
|
if options[:cli_mode]
|
35
78
|
Keeptesting::CLI::start_test_loop(options)
|
36
79
|
else
|
37
80
|
Keeptesting::BrowserConsole.new(options)
|
38
81
|
end
|
39
|
-
|
40
|
-
|
@@ -47,10 +47,14 @@ module Keeptesting
|
|
47
47
|
Thread.new do
|
48
48
|
console = self
|
49
49
|
console.testrun(options)
|
50
|
-
FSSM.monitor
|
51
|
-
|
52
|
-
|
53
|
-
|
50
|
+
FSSM.monitor do
|
51
|
+
options[:watched_paths].each do |watched_path|
|
52
|
+
path watched_path do
|
53
|
+
update {|base, relative| console.testrun(options)}
|
54
|
+
delete {|base, relative| console.testrun(options)}
|
55
|
+
create {|base, relative| console.testrun(options)}
|
56
|
+
end
|
57
|
+
end
|
54
58
|
end
|
55
59
|
end
|
56
60
|
end
|
data/lib/keeptesting/cli.rb
CHANGED
@@ -28,11 +28,16 @@ module Keeptesting
|
|
28
28
|
|
29
29
|
def self.start_test_loop(options)
|
30
30
|
Keeptesting::CLI::testrun(options)
|
31
|
-
FSSM.monitor
|
32
|
-
|
33
|
-
|
34
|
-
|
31
|
+
FSSM.monitor do
|
32
|
+
options[:watched_paths].each do |watched_path|
|
33
|
+
path watched_path do
|
34
|
+
update {|base, relative| Keeptesting::CLI::testrun(options)}
|
35
|
+
delete {|base, relative| Keeptesting::CLI::testrun(options)}
|
36
|
+
create {|base, relative| Keeptesting::CLI::testrun(options)}
|
37
|
+
end
|
38
|
+
end
|
35
39
|
end
|
36
40
|
end
|
41
|
+
|
37
42
|
end
|
38
43
|
end
|
data/lib/keeptesting/version.rb
CHANGED
data/test/test_keeptesting.rb
CHANGED
data/todo.org
CHANGED
@@ -1,22 +1,17 @@
|
|
1
|
-
* improve web console
|
2
|
-
handle situation where test fails before have a time to get output?
|
3
|
-
raise error out side method def
|
4
|
-
what happens?
|
5
|
-
blank output in web
|
6
|
-
show error when backend is down
|
7
|
-
prettier html output
|
8
|
-
less chatty communication w. server, use websockets?
|
9
1
|
* improve overall interface
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
2
|
+
** .keeptesting
|
3
|
+
*** enable dotfile for standard options
|
4
|
+
*** can just start with keeptesting w/o options
|
5
|
+
* swap out fssm w/ guard/listen
|
6
|
+
** fssm is dead!
|
7
|
+
* improve web console
|
8
|
+
** show error when backend is down
|
9
|
+
** prettier html output
|
10
|
+
** less chatty communication w. server, use websockets?
|
16
11
|
* test that everything works x-platform
|
17
12
|
* create proper documentation
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
13
|
+
** website
|
14
|
+
** great readme page with screencaptures and workflow examples
|
15
|
+
** screencast
|
16
|
+
** blog post - release announcement
|
22
17
|
* release 1.0
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: keeptesting
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-04-22 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: OptionParser
|
16
|
-
requirement: &
|
16
|
+
requirement: &24000840 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *24000840
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: fssm
|
27
|
-
requirement: &
|
27
|
+
requirement: &24000300 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *24000300
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: sinatra
|
38
|
-
requirement: &
|
38
|
+
requirement: &23999780 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *23999780
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: mocha
|
49
|
-
requirement: &
|
49
|
+
requirement: &23999360 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *23999360
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: shoulda
|
60
|
-
requirement: &
|
60
|
+
requirement: &23998820 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *23998820
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: minitest
|
71
|
-
requirement: &
|
71
|
+
requirement: &23998240 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *23998240
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: shoulda-context
|
82
|
-
requirement: &
|
82
|
+
requirement: &23997800 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,7 +87,7 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *23997800
|
91
91
|
description: ! 'Usage: keeptesting [options] TESTCOMMAND'
|
92
92
|
email:
|
93
93
|
- thomas@kjeldahlnilsson.net
|