cutest 1.0.1 → 1.1.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/cutest +6 -2
- data/cutest.gemspec +1 -1
- data/lib/cutest.rb +21 -30
- data/test/run.rb +1 -1
- metadata +6 -8
data/bin/cutest
CHANGED
@@ -63,7 +63,11 @@ class Cutest
|
|
63
63
|
end
|
64
64
|
|
65
65
|
files = Cutest::Clap.run ARGV,
|
66
|
-
"-r" => lambda { |file|
|
66
|
+
"-r" => lambda { |file| Cutest::REQUIREMENTS.push(file) },
|
67
67
|
"-v" => lambda { puts Cutest::VERSION }
|
68
68
|
|
69
|
-
|
69
|
+
case files.size
|
70
|
+
when 0 then exit
|
71
|
+
when 1 then Cutest.run_file(files.first)
|
72
|
+
else Cutest.run(Dir[*files])
|
73
|
+
end
|
data/cutest.gemspec
CHANGED
data/lib/cutest.rb
CHANGED
@@ -1,42 +1,33 @@
|
|
1
1
|
class Cutest
|
2
|
-
VERSION = "1.0.
|
2
|
+
VERSION = "1.1.0.rc1"
|
3
|
+
REQUIREMENTS = []
|
4
|
+
|
5
|
+
def self.flags
|
6
|
+
"-r #{REQUIREMENTS.join(" ")}" if REQUIREMENTS.any?
|
7
|
+
end
|
3
8
|
|
4
9
|
def self.run(files)
|
5
10
|
files.each do |file|
|
6
|
-
|
7
|
-
|
8
|
-
fork do
|
9
|
-
stdin.close
|
10
|
-
|
11
|
-
begin
|
12
|
-
load(file)
|
13
|
-
|
14
|
-
rescue LoadError, SyntaxError
|
15
|
-
puts ["\n", error([file, $!.message])]
|
16
|
-
exit
|
17
|
-
|
18
|
-
rescue Exception
|
19
|
-
fn, ln = $!.backtrace.first.split(":")
|
20
|
-
message = File.readlines(fn)[ln.to_i - 1]
|
21
|
-
stdout.write("#{fn}\n#{ln}\n#{error(message.strip)} # #{$!.message}")
|
22
|
-
end
|
23
|
-
|
24
|
-
stdout.close
|
25
|
-
end
|
26
|
-
|
27
|
-
stdout.close
|
11
|
+
%x{cutest #{flags} #{file}}.chomp.display
|
12
|
+
end
|
28
13
|
|
29
|
-
|
14
|
+
puts
|
15
|
+
end
|
30
16
|
|
31
|
-
|
17
|
+
def self.run_file(file)
|
18
|
+
begin
|
19
|
+
REQUIREMENTS.each { |r| require r }
|
32
20
|
|
33
|
-
|
21
|
+
load(file)
|
34
22
|
|
35
|
-
|
36
|
-
|
23
|
+
rescue LoadError, SyntaxError
|
24
|
+
puts ["\n", error([file, $!.message])]
|
25
|
+
exit
|
37
26
|
|
38
|
-
|
39
|
-
|
27
|
+
rescue Exception
|
28
|
+
fn, ln = $!.backtrace.first.split(":")
|
29
|
+
message = File.readlines(fn)[ln.to_i - 1]
|
30
|
+
puts "\n#{error(message.strip)} # #{$!.message}\n#{fn} +#{ln}"
|
40
31
|
end
|
41
32
|
|
42
33
|
puts
|
data/test/run.rb
CHANGED
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cutest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
version: 1.0.
|
4
|
+
prerelease: 6
|
5
|
+
version: 1.1.0.rc1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Damian Janowski
|
@@ -11,8 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2011-
|
15
|
-
default_executable:
|
14
|
+
date: 2011-04-22 00:00:00 Z
|
16
15
|
dependencies: []
|
17
16
|
|
18
17
|
description: Run tests in separate processes to avoid shared state.
|
@@ -39,7 +38,6 @@ files:
|
|
39
38
|
- test/scopes.rb
|
40
39
|
- test/setup.rb
|
41
40
|
- bin/cutest
|
42
|
-
has_rdoc: true
|
43
41
|
homepage: http://github.com/djanowski/cutest
|
44
42
|
licenses: []
|
45
43
|
|
@@ -57,13 +55,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
57
55
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
56
|
none: false
|
59
57
|
requirements:
|
60
|
-
- - "
|
58
|
+
- - ">"
|
61
59
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
60
|
+
version: 1.3.1
|
63
61
|
requirements: []
|
64
62
|
|
65
63
|
rubyforge_project:
|
66
|
-
rubygems_version: 1.
|
64
|
+
rubygems_version: 1.7.2
|
67
65
|
signing_key:
|
68
66
|
specification_version: 3
|
69
67
|
summary: Forking tests.
|