moonit 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +7 -0
- data/Manifest.txt +6 -0
- data/README.txt +59 -0
- data/Rakefile +14 -0
- data/lib/moonit.rb +55 -0
- data/test/test_moonit.rb +13 -0
- metadata +79 -0
data/History.txt
ADDED
data/Manifest.txt
ADDED
data/README.txt
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
= moonit
|
2
|
+
|
3
|
+
* http://moonit.rubyforge.org
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
Baby mix-in for Test::Unit which allows one to specify manual test cases with steps. Manual test cases are a necessary evil in this world and something that I feel is missing sorely (but not sadly) is the ability to keep your manual test cases coupled with your automated test cases. Manual tests playing with automated tests. Of course, the goal of Moonit is to not interfere with automated tests so it is necessary to tell ruby you want to execute your manual tests alongside your automated tests at runtime.
|
8
|
+
|
9
|
+
== FEATURES/PROBLEMS:
|
10
|
+
|
11
|
+
* manual tests with steps
|
12
|
+
* manual tests do not interfere with automated runs
|
13
|
+
* easy manual test naming, no need for cumbersome underscores
|
14
|
+
|
15
|
+
== SYNOPSIS:
|
16
|
+
|
17
|
+
class TestLolz < Test::Unit::TestCase
|
18
|
+
include Moonit
|
19
|
+
manual_test "Loling the Lulz gives you ROFLZ!" do
|
20
|
+
step "Do this"
|
21
|
+
step "Do that"
|
22
|
+
end
|
23
|
+
def test_lolz
|
24
|
+
assert true
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
== REQUIREMENTS:
|
29
|
+
|
30
|
+
* highline 1.4.0+
|
31
|
+
|
32
|
+
== INSTALL:
|
33
|
+
|
34
|
+
* sudo gem install moonit
|
35
|
+
|
36
|
+
== LICENSE:
|
37
|
+
|
38
|
+
(The MIT License)
|
39
|
+
|
40
|
+
Copyright (c) 2008 The Moon
|
41
|
+
|
42
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
43
|
+
a copy of this software and associated documentation files (the
|
44
|
+
'Software'), to deal in the Software without restriction, including
|
45
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
46
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
47
|
+
permit persons to whom the Software is furnished to do so, subject to
|
48
|
+
the following conditions:
|
49
|
+
|
50
|
+
The above copyright notice and this permission notice shall be
|
51
|
+
included in all copies or substantial portions of the Software.
|
52
|
+
|
53
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
54
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
55
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
56
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
57
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
58
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
59
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'hoe'
|
5
|
+
require './lib/moonit.rb'
|
6
|
+
|
7
|
+
Hoe.new('moonit', Moonit::VERSION) do |p|
|
8
|
+
p.rubyforge_name = 'moonit' # if different than lowercase project name
|
9
|
+
p.developer('Adam Anderson', 'adamandersonis@gmail.com')
|
10
|
+
p.extra_deps = ['highline']
|
11
|
+
p.remote_rdoc_dir = ''
|
12
|
+
end
|
13
|
+
|
14
|
+
# vim: syntax=Ruby
|
data/lib/moonit.rb
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
module Moonit
|
2
|
+
VERSION = '0.0.1'
|
3
|
+
end
|
4
|
+
# Moonit
|
5
|
+
# Manual Test Unit Tests
|
6
|
+
#
|
7
|
+
# Example:
|
8
|
+
# require 'rubygems'
|
9
|
+
# require 'moonit'
|
10
|
+
#
|
11
|
+
# class TestLolz < Test::Unit::TestCase
|
12
|
+
# include Moonit
|
13
|
+
# manual_test "Loling the Lulz gives you ROFLZ!" do
|
14
|
+
# step "LOL Lulz"
|
15
|
+
# step "Verify we got the ROFLZ"
|
16
|
+
# end
|
17
|
+
# def test_lolz
|
18
|
+
# assert true
|
19
|
+
# end
|
20
|
+
# end
|
21
|
+
#
|
22
|
+
# Then at the command line:
|
23
|
+
# with manual tests:
|
24
|
+
# ruby test_lolz.rb manual=true
|
25
|
+
# without manual tests:
|
26
|
+
# ruby test_lolz.rb
|
27
|
+
|
28
|
+
require 'rubygems'
|
29
|
+
require 'highline/import'
|
30
|
+
require 'test/unit/testcase'
|
31
|
+
|
32
|
+
ARGV.each do |arg|
|
33
|
+
key,val = arg.split("=")
|
34
|
+
ENV[key.upcase] = val
|
35
|
+
end
|
36
|
+
|
37
|
+
class Test::Unit::TestCase
|
38
|
+
def self.manual_test(name)
|
39
|
+
if ENV['MANUAL']
|
40
|
+
puts "\n" + name
|
41
|
+
yield if block_given?
|
42
|
+
proc = if ask("Passed? ") {|q| q.default = "Y"} =~ /y/i
|
43
|
+
Proc.new {assert true}
|
44
|
+
else
|
45
|
+
reason = ask("Why did this fail? ")
|
46
|
+
Proc.new {assert false, reason}
|
47
|
+
end
|
48
|
+
define_method("test_#{name.gsub(/[^\w]/,'_')}_manual",proc)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.step(description,&block)
|
53
|
+
ask("#{description} ",&block)
|
54
|
+
end
|
55
|
+
end
|
data/test/test_moonit.rb
ADDED
metadata
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: moonit
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Adam Anderson
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-04-05 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: highline
|
17
|
+
version_requirement:
|
18
|
+
version_requirements: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: "0"
|
23
|
+
version:
|
24
|
+
- !ruby/object:Gem::Dependency
|
25
|
+
name: hoe
|
26
|
+
version_requirement:
|
27
|
+
version_requirements: !ruby/object:Gem::Requirement
|
28
|
+
requirements:
|
29
|
+
- - ">="
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: 1.5.1
|
32
|
+
version:
|
33
|
+
description: Baby mix-in for Test::Unit which allows one to specify manual test cases with steps. Manual test cases are a necessary evil in this world and something that I feel is missing sorely (but not sadly) is the ability to keep your manual test cases coupled with your automated test cases. Manual tests playing with automated tests. Of course, the goal of Moonit is to not interfere with automated tests so it is necessary to tell ruby you want to execute your manual tests alongside your automated tests at runtime.
|
34
|
+
email:
|
35
|
+
- adamandersonis@gmail.com
|
36
|
+
executables: []
|
37
|
+
|
38
|
+
extensions: []
|
39
|
+
|
40
|
+
extra_rdoc_files:
|
41
|
+
- History.txt
|
42
|
+
- Manifest.txt
|
43
|
+
- README.txt
|
44
|
+
files:
|
45
|
+
- History.txt
|
46
|
+
- Manifest.txt
|
47
|
+
- README.txt
|
48
|
+
- Rakefile
|
49
|
+
- lib/moonit.rb
|
50
|
+
- test/test_moonit.rb
|
51
|
+
has_rdoc: true
|
52
|
+
homepage: http://moonit.rubyforge.org
|
53
|
+
post_install_message:
|
54
|
+
rdoc_options:
|
55
|
+
- --main
|
56
|
+
- README.txt
|
57
|
+
require_paths:
|
58
|
+
- lib
|
59
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: "0"
|
64
|
+
version:
|
65
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: "0"
|
70
|
+
version:
|
71
|
+
requirements: []
|
72
|
+
|
73
|
+
rubyforge_project: moonit
|
74
|
+
rubygems_version: 1.1.0
|
75
|
+
signing_key:
|
76
|
+
specification_version: 2
|
77
|
+
summary: Baby mix-in for Test::Unit which allows one to specify manual test cases with steps
|
78
|
+
test_files:
|
79
|
+
- test/test_moonit.rb
|