cutest-report 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +76 -0
- data/Rakefile +6 -0
- data/cutest-report.gemspec +10 -0
- data/lib/cutest-report.rb +42 -0
- data/test/examples.rb +37 -0
- metadata +83 -0
data/README.markdown
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
Cutest Report
|
2
|
+
=============
|
3
|
+
|
4
|
+
Beautiful reports for [Cutest](http://github.com/djanowski/cutest).
|
5
|
+
|
6
|
+
Usage
|
7
|
+
-----
|
8
|
+
|
9
|
+
require "cutest-report"
|
10
|
+
|
11
|
+
describe "A User" do
|
12
|
+
before do
|
13
|
+
@user = User.new("John Doe")
|
14
|
+
end
|
15
|
+
|
16
|
+
it "has a name." do
|
17
|
+
assert_equal "John Doe", @user.name
|
18
|
+
end
|
19
|
+
|
20
|
+
it "has an email."
|
21
|
+
end
|
22
|
+
|
23
|
+
# Or
|
24
|
+
|
25
|
+
context "A User" do
|
26
|
+
setup do
|
27
|
+
@user = User.new
|
28
|
+
end
|
29
|
+
|
30
|
+
should "have a name." do
|
31
|
+
assert_equal "Unknown", @user.name
|
32
|
+
end
|
33
|
+
|
34
|
+
should "have an email."
|
35
|
+
end
|
36
|
+
|
37
|
+
Will output:
|
38
|
+
|
39
|
+
A User
|
40
|
+
- has a name.
|
41
|
+
- has an email. (pending)
|
42
|
+
|
43
|
+
A User
|
44
|
+
- have a name.
|
45
|
+
- have an email. (pending)
|
46
|
+
|
47
|
+
Installation
|
48
|
+
------------
|
49
|
+
|
50
|
+
$ gem install cutest-report
|
51
|
+
|
52
|
+
License
|
53
|
+
-------
|
54
|
+
|
55
|
+
Copyright (c) 2010 Ariel H. Pillet
|
56
|
+
|
57
|
+
Permission is hereby granted, free of charge, to any person
|
58
|
+
obtaining a copy of this software and associated documentation
|
59
|
+
files (the "Software"), to deal in the Software without
|
60
|
+
restriction, including without limitation the rights to use,
|
61
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
62
|
+
copies of the Software, and to permit persons to whom the
|
63
|
+
Software is furnished to do so, subject to the following
|
64
|
+
conditions:
|
65
|
+
|
66
|
+
The above copyright notice and this permission notice shall be
|
67
|
+
included in all copies or substantial portions of the Software.
|
68
|
+
|
69
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
70
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
71
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
72
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
73
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
74
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
75
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
76
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = "cutest-report"
|
3
|
+
s.version = "0.0.1"
|
4
|
+
s.summary = "Beautiful reports for Cutest."
|
5
|
+
s.authors = ["Ariel H. Pillet"]
|
6
|
+
s.email = ["apillet@gmail.com"]
|
7
|
+
s.homepage = "http://github.com/apillet/cutest-report"
|
8
|
+
s.files = ["README.markdown", "Rakefile", "lib/cutest-report.rb", "cutest-report.gemspec", "test/examples.rb"]
|
9
|
+
s.add_dependency "cutest", ">= 1.0.0"
|
10
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require "cutest"
|
2
|
+
|
3
|
+
module CutestReport
|
4
|
+
VERSION = "0.0.1"
|
5
|
+
end
|
6
|
+
|
7
|
+
module Color
|
8
|
+
WHITE = "37"
|
9
|
+
GREEN = "32"
|
10
|
+
YELLOW = "33"
|
11
|
+
end
|
12
|
+
|
13
|
+
module Kernel
|
14
|
+
private
|
15
|
+
|
16
|
+
def success
|
17
|
+
""
|
18
|
+
end
|
19
|
+
|
20
|
+
def describe name, &block
|
21
|
+
puts
|
22
|
+
display name
|
23
|
+
scope &block
|
24
|
+
end
|
25
|
+
|
26
|
+
def it name = nil, &block
|
27
|
+
if block_given?
|
28
|
+
test name, &block
|
29
|
+
display " - #{name}", Color::GREEN
|
30
|
+
else
|
31
|
+
display " - #{name} (pending)", Color::YELLOW
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
alias before setup
|
36
|
+
alias context describe
|
37
|
+
alias should it
|
38
|
+
|
39
|
+
def display str = "", color = Color::WHITE
|
40
|
+
puts "\033[1;#{color}m#{str}\033[0m"
|
41
|
+
end
|
42
|
+
end
|
data/test/examples.rb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + "/../lib/cutest-report")
|
2
|
+
|
3
|
+
class User
|
4
|
+
attr_reader :name
|
5
|
+
|
6
|
+
def initialize name = "Unknown"
|
7
|
+
@name = name
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
# A.
|
12
|
+
#
|
13
|
+
describe "A User" do
|
14
|
+
before do
|
15
|
+
@user = User.new("John Doe")
|
16
|
+
end
|
17
|
+
|
18
|
+
it "has a name." do
|
19
|
+
assert_equal "John Doe", @user.name
|
20
|
+
end
|
21
|
+
|
22
|
+
it "has an email."
|
23
|
+
end
|
24
|
+
|
25
|
+
# B.
|
26
|
+
#
|
27
|
+
context "A User" do
|
28
|
+
setup do
|
29
|
+
@user = User.new
|
30
|
+
end
|
31
|
+
|
32
|
+
should "have a name." do
|
33
|
+
assert_equal "Unknown", @user.name
|
34
|
+
end
|
35
|
+
|
36
|
+
should "have an email."
|
37
|
+
end
|
metadata
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cutest-report
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
version: 0.0.1
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Ariel H. Pillet
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-11-11 00:00:00 -02:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: cutest
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 1
|
30
|
+
- 0
|
31
|
+
- 0
|
32
|
+
version: 1.0.0
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
description:
|
36
|
+
email:
|
37
|
+
- apillet@gmail.com
|
38
|
+
executables: []
|
39
|
+
|
40
|
+
extensions: []
|
41
|
+
|
42
|
+
extra_rdoc_files: []
|
43
|
+
|
44
|
+
files:
|
45
|
+
- README.markdown
|
46
|
+
- Rakefile
|
47
|
+
- lib/cutest-report.rb
|
48
|
+
- cutest-report.gemspec
|
49
|
+
- test/examples.rb
|
50
|
+
has_rdoc: true
|
51
|
+
homepage: http://github.com/apillet/cutest-report
|
52
|
+
licenses: []
|
53
|
+
|
54
|
+
post_install_message:
|
55
|
+
rdoc_options: []
|
56
|
+
|
57
|
+
require_paths:
|
58
|
+
- lib
|
59
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
60
|
+
none: false
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
segments:
|
65
|
+
- 0
|
66
|
+
version: "0"
|
67
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
|
+
none: false
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
segments:
|
73
|
+
- 0
|
74
|
+
version: "0"
|
75
|
+
requirements: []
|
76
|
+
|
77
|
+
rubyforge_project:
|
78
|
+
rubygems_version: 1.3.7
|
79
|
+
signing_key:
|
80
|
+
specification_version: 3
|
81
|
+
summary: Beautiful reports for Cutest.
|
82
|
+
test_files: []
|
83
|
+
|