rcomp 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +24 -0
- data/.travis.yml +9 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +39 -0
- data/LICENSE +7 -0
- data/README.md +124 -0
- data/Rakefile +7 -0
- data/bin/rcomp +6 -0
- data/contributing.md +7 -0
- data/features/generate.feature +224 -0
- data/features/init.feature +44 -0
- data/features/set_command.feature +24 -0
- data/features/set_directory.feature +22 -0
- data/features/support/env.rb +66 -0
- data/features/test.feature +169 -0
- data/features/version.feature +6 -0
- data/lib/rcomp/actions.rb +35 -0
- data/lib/rcomp/cli.rb +124 -0
- data/lib/rcomp/conf.rb +128 -0
- data/lib/rcomp/helper.rb +22 -0
- data/lib/rcomp/path.rb +28 -0
- data/lib/rcomp/reporter.rb +81 -0
- data/lib/rcomp/runner.rb +104 -0
- data/lib/rcomp/suite.rb +32 -0
- data/lib/rcomp/test.rb +27 -0
- data/lib/rcomp/version.rb +3 -0
- data/lib/rcomp.rb +9 -0
- data/rcomp.gemspec +29 -0
- metadata +147 -0
data/lib/rcomp/suite.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'find'
|
2
|
+
|
3
|
+
module RComp
|
4
|
+
module Suite
|
5
|
+
|
6
|
+
include RComp::Path
|
7
|
+
|
8
|
+
# Create a test suite
|
9
|
+
#
|
10
|
+
# pattern - A pattern to filter the tests that are added to the suite
|
11
|
+
#
|
12
|
+
# Returns an Array of Test objects
|
13
|
+
def load_suite(pattern='')
|
14
|
+
tests = []
|
15
|
+
|
16
|
+
# Find all tests in the tests directory
|
17
|
+
Find.find Conf.instance.test_root do |path|
|
18
|
+
# recurse into all subdirectories
|
19
|
+
next if File.directory? path
|
20
|
+
|
21
|
+
# filter tests by pattern if present
|
22
|
+
unless pattern.empty?
|
23
|
+
next unless rel_path(path).match(pattern)
|
24
|
+
end
|
25
|
+
|
26
|
+
tests << Test.new(path)
|
27
|
+
end
|
28
|
+
|
29
|
+
tests
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/rcomp/test.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
module RComp
|
2
|
+
class Test
|
3
|
+
|
4
|
+
include RComp::Path
|
5
|
+
|
6
|
+
attr_reader :test_path, :result_out_path, :result_err_path,
|
7
|
+
:expected_out_path, :expected_err_path, :relative_path
|
8
|
+
|
9
|
+
attr_accessor :result
|
10
|
+
|
11
|
+
# Initialize a new Test
|
12
|
+
#
|
13
|
+
# path - The absolute path to the test
|
14
|
+
#
|
15
|
+
# Stores relative path, paths to expected and result out/err and
|
16
|
+
# defaults result to :skipped
|
17
|
+
def initialize(path)
|
18
|
+
@result = :skipped
|
19
|
+
@relative_path = rel_path(path)
|
20
|
+
@test_path = path
|
21
|
+
@result_out_path = result_path(path, :out)
|
22
|
+
@result_err_path = result_path(path, :err)
|
23
|
+
@expected_out_path = expected_path(path, :out)
|
24
|
+
@expected_err_path = expected_path(path, :err)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/rcomp.rb
ADDED
data/rcomp.gemspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "rcomp/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "rcomp"
|
7
|
+
s.version = RComp::VERSION
|
8
|
+
s.license = "MIT"
|
9
|
+
s.authors = ["Chris Knadler"]
|
10
|
+
s.email = ["takeshi91k@gmail.com"]
|
11
|
+
s.homepage = "https://github.com/cknadler/rcomp"
|
12
|
+
s.summary = "A simple framework for testing command line application output."
|
13
|
+
s.description = "RComp tests by passing a specified command tests (files) by argument and comparing the result with expected output."
|
14
|
+
|
15
|
+
s.required_ruby_version = ">= 1.9.3"
|
16
|
+
|
17
|
+
s.rubyforge_project = "rcomp"
|
18
|
+
|
19
|
+
s.files = `git ls-files`.split("\n")
|
20
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
21
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
22
|
+
s.require_paths = ["lib"]
|
23
|
+
|
24
|
+
s.add_runtime_dependency("thor", "~> 0.16.0")
|
25
|
+
|
26
|
+
s.add_development_dependency("rake")
|
27
|
+
s.add_development_dependency("cucumber", "~> 1.2.1")
|
28
|
+
s.add_development_dependency("aruba", "~> 0.5.0")
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,147 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rcomp
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Chris Knadler
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-11-20 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: thor
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.16.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.16.0
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: cucumber
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 1.2.1
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.2.1
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: aruba
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 0.5.0
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 0.5.0
|
78
|
+
description: RComp tests by passing a specified command tests (files) by argument
|
79
|
+
and comparing the result with expected output.
|
80
|
+
email:
|
81
|
+
- takeshi91k@gmail.com
|
82
|
+
executables:
|
83
|
+
- rcomp
|
84
|
+
extensions: []
|
85
|
+
extra_rdoc_files: []
|
86
|
+
files:
|
87
|
+
- .gitignore
|
88
|
+
- .travis.yml
|
89
|
+
- Gemfile
|
90
|
+
- Gemfile.lock
|
91
|
+
- LICENSE
|
92
|
+
- README.md
|
93
|
+
- Rakefile
|
94
|
+
- bin/rcomp
|
95
|
+
- contributing.md
|
96
|
+
- features/generate.feature
|
97
|
+
- features/init.feature
|
98
|
+
- features/set_command.feature
|
99
|
+
- features/set_directory.feature
|
100
|
+
- features/support/env.rb
|
101
|
+
- features/test.feature
|
102
|
+
- features/version.feature
|
103
|
+
- lib/rcomp.rb
|
104
|
+
- lib/rcomp/actions.rb
|
105
|
+
- lib/rcomp/cli.rb
|
106
|
+
- lib/rcomp/conf.rb
|
107
|
+
- lib/rcomp/helper.rb
|
108
|
+
- lib/rcomp/path.rb
|
109
|
+
- lib/rcomp/reporter.rb
|
110
|
+
- lib/rcomp/runner.rb
|
111
|
+
- lib/rcomp/suite.rb
|
112
|
+
- lib/rcomp/test.rb
|
113
|
+
- lib/rcomp/version.rb
|
114
|
+
- rcomp.gemspec
|
115
|
+
homepage: https://github.com/cknadler/rcomp
|
116
|
+
licenses:
|
117
|
+
- MIT
|
118
|
+
post_install_message:
|
119
|
+
rdoc_options: []
|
120
|
+
require_paths:
|
121
|
+
- lib
|
122
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
123
|
+
none: false
|
124
|
+
requirements:
|
125
|
+
- - ! '>='
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: 1.9.3
|
128
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
requirements: []
|
135
|
+
rubyforge_project: rcomp
|
136
|
+
rubygems_version: 1.8.24
|
137
|
+
signing_key:
|
138
|
+
specification_version: 3
|
139
|
+
summary: A simple framework for testing command line application output.
|
140
|
+
test_files:
|
141
|
+
- features/generate.feature
|
142
|
+
- features/init.feature
|
143
|
+
- features/set_command.feature
|
144
|
+
- features/set_directory.feature
|
145
|
+
- features/support/env.rb
|
146
|
+
- features/test.feature
|
147
|
+
- features/version.feature
|