specrun 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README +7 -0
- data/lib/build_files.rb +31 -0
- data/lib/gather_specs.rb +27 -0
- data/lib/specrun.rb +7 -0
- metadata +56 -0
data/README
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
The specrun package is intended to compile rspec results into a browseable format similar to rdoc. Currently it's features are very limited and consist only of:
|
2
|
+
|
3
|
+
) Creates a directory structure mimicing that of your spec directory.
|
4
|
+
) Runs all rspec tests.
|
5
|
+
) Compiles standard html output of rspec for each test.
|
6
|
+
|
7
|
+
The todo list is too long to compile as of yet, stay tuned for future version.
|
data/lib/build_files.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
|
2
|
+
def make_structure(paths)
|
3
|
+
unless File::exists?("spec_results")
|
4
|
+
Dir.mkdir("spec_results")
|
5
|
+
puts "Creating new directory 'spec_results'"
|
6
|
+
end
|
7
|
+
Dir.chdir "spec_results"
|
8
|
+
paths.each do |path|
|
9
|
+
files = path.split("/")
|
10
|
+
files.size.times do |x|
|
11
|
+
unless File::exists?(files[x])
|
12
|
+
if files[x].include?("_spec.rb")
|
13
|
+
next
|
14
|
+
else
|
15
|
+
Dir.mkdir(files[x])
|
16
|
+
puts "Creating new directory '#{files[x]}'"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
Dir.chdir(files[x])
|
20
|
+
puts "Entering created directory '#{files[x]}'"
|
21
|
+
end
|
22
|
+
back_up = files.size-1
|
23
|
+
back_up.times {Dir.chdir('..')}
|
24
|
+
afile = File.new("#{path.gsub('.rb','.html')}", 'w')
|
25
|
+
puts "Creating new File '#{path}.html'"
|
26
|
+
Dir.chdir('..')
|
27
|
+
afile.puts `spec -f h #{path}`
|
28
|
+
afile.close
|
29
|
+
Dir.chdir('spec_results')
|
30
|
+
end
|
31
|
+
end
|
data/lib/gather_specs.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'find'
|
2
|
+
|
3
|
+
class User
|
4
|
+
def initialize(args)
|
5
|
+
@a = args
|
6
|
+
@b = 5
|
7
|
+
@c = 2
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def gather_specs(spec_dir, spec_name)
|
12
|
+
files = []
|
13
|
+
Find.find(spec_dir) do |path|
|
14
|
+
if FileTest.directory?(path)
|
15
|
+
if File.basename(path)[0] == ?.
|
16
|
+
Find.prune
|
17
|
+
else
|
18
|
+
next
|
19
|
+
end
|
20
|
+
else
|
21
|
+
if path.include? spec_name
|
22
|
+
files.push path
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
return files
|
27
|
+
end
|
data/lib/specrun.rb
ADDED
metadata
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: specrun
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Chris Bailey
|
8
|
+
autorequire: specrun
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-12-13 00:00:00 -05:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description:
|
17
|
+
email: christopher.sean.bailey@nospam@gmail.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- README
|
24
|
+
files:
|
25
|
+
- lib/gather_specs.rb
|
26
|
+
- lib/build_files.rb
|
27
|
+
- lib/specrun.rb
|
28
|
+
- README
|
29
|
+
has_rdoc: true
|
30
|
+
homepage: http://specrun.rubyforge.com
|
31
|
+
post_install_message:
|
32
|
+
rdoc_options: []
|
33
|
+
|
34
|
+
require_paths:
|
35
|
+
- lib
|
36
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: "0"
|
41
|
+
version:
|
42
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: "0"
|
47
|
+
version:
|
48
|
+
requirements: []
|
49
|
+
|
50
|
+
rubyforge_project: specrun
|
51
|
+
rubygems_version: 1.3.1
|
52
|
+
signing_key:
|
53
|
+
specification_version: 2
|
54
|
+
summary: A package for generating rdoc like output for rspec.
|
55
|
+
test_files: []
|
56
|
+
|