dust 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +0 -0
- data/lib/dust.rb +25 -0
- data/rakefile.rb +50 -0
- data/test/all_tests.rb +1 -0
- data/test/functional_test.rb +7 -0
- data/test/test_helper.rb +2 -0
- data/test/unit_test.rb +7 -0
- metadata +56 -0
data/README
ADDED
File without changes
|
data/lib/dust.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
class Object
|
2
|
+
def unit_tests(&block)
|
3
|
+
full_path_file_name = eval "__FILE__", block.binding
|
4
|
+
test_name = File.basename(full_path_file_name, ".rb")
|
5
|
+
test_class = eval "module Units; class #{test_name.capitalize} < Test::Unit::TestCase; self; end; end"
|
6
|
+
test_class.class_eval &block
|
7
|
+
end
|
8
|
+
|
9
|
+
def functional_tests(&block)
|
10
|
+
full_path_file_name = eval "__FILE__", block.binding
|
11
|
+
test_name = File.basename(full_path_file_name, ".rb")
|
12
|
+
test_class = eval "module Functionals; class #{test_name.capitalize} < Test::Unit::TestCase; self; end; end"
|
13
|
+
test_class.class_eval &block
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
class Test::Unit::TestCase
|
18
|
+
def self.test(name, &block)
|
19
|
+
test_name = "test_#{name.gsub(/[\s]/,'_')}".to_sym
|
20
|
+
raise "#{test_name} is already defined in #{self}" if self.instance_methods.include? test_name.to_s
|
21
|
+
define_method test_name do
|
22
|
+
instance_eval &block
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/rakefile.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake/gempackagetask'
|
3
|
+
require 'rake/rdoctask'
|
4
|
+
require 'rake/contrib/sshpublisher'
|
5
|
+
|
6
|
+
task :default => :test
|
7
|
+
|
8
|
+
task :test do
|
9
|
+
require File.dirname(__FILE__) + '/test/all_tests.rb'
|
10
|
+
end
|
11
|
+
|
12
|
+
desc 'Generate RDoc'
|
13
|
+
Rake::RDocTask.new do |task|
|
14
|
+
task.main = 'README'
|
15
|
+
task.title = 'Dust'
|
16
|
+
task.rdoc_dir = 'doc'
|
17
|
+
task.options << "--line-numbers" << "--inline-source"
|
18
|
+
task.rdoc_files.include('README', 'lib/**/*.rb')
|
19
|
+
end
|
20
|
+
|
21
|
+
desc "Upload RDoc to RubyForge"
|
22
|
+
task :publish_rdoc => [:rdoc] do
|
23
|
+
Rake::SshDirPublisher.new("jaycfields@rubyforge.org", "/var/www/gforge-projects/dust", "doc").upload
|
24
|
+
end
|
25
|
+
|
26
|
+
Gem::manage_gems
|
27
|
+
|
28
|
+
specification = Gem::Specification.new do |s|
|
29
|
+
s.name = "dust"
|
30
|
+
s.summary = "Dust is an add on for Test::Unit that allows an alternative test definintion syntax."
|
31
|
+
s.version = "0.1.0"
|
32
|
+
s.author = 'Jay Fields'
|
33
|
+
s.description = "Dust is an add on for Test::Unit that allows an alternative test definintion syntax."
|
34
|
+
s.email = 'dust-developer@rubyforge.org'
|
35
|
+
s.homepage = 'http://dust.rubyforge.org'
|
36
|
+
s.rubyforge_project = 'dust'
|
37
|
+
|
38
|
+
s.has_rdoc = true
|
39
|
+
s.extra_rdoc_files = ['README']
|
40
|
+
s.rdoc_options << '--title' << 'Dust' << '--main' << 'README' << '--line-numbers'
|
41
|
+
|
42
|
+
s.autorequire = 'dust'
|
43
|
+
s.files = FileList['{lib,test}/**/*.rb', '[A-Z]*$', 'rakefile.rb'].to_a
|
44
|
+
s.test_file = "test/all_tests.rb"
|
45
|
+
end
|
46
|
+
|
47
|
+
Rake::GemPackageTask.new(specification) do |package|
|
48
|
+
package.need_zip = false
|
49
|
+
package.need_tar = false
|
50
|
+
end
|
data/test/all_tests.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Dir['**/*_test.rb'].each { |test_case| require test_case }
|
data/test/test_helper.rb
ADDED
data/test/unit_test.rb
ADDED
metadata
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: 0.9.2
|
3
|
+
specification_version: 1
|
4
|
+
name: dust
|
5
|
+
version: !ruby/object:Gem::Version
|
6
|
+
version: 0.1.0
|
7
|
+
date: 2007-08-14 00:00:00 -04:00
|
8
|
+
summary: Dust is an add on for Test::Unit that allows an alternative test definintion syntax.
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
email: dust-developer@rubyforge.org
|
12
|
+
homepage: http://dust.rubyforge.org
|
13
|
+
rubyforge_project: dust
|
14
|
+
description: Dust is an add on for Test::Unit that allows an alternative test definintion syntax.
|
15
|
+
autorequire: dust
|
16
|
+
default_executable:
|
17
|
+
bindir: bin
|
18
|
+
has_rdoc: true
|
19
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.0
|
24
|
+
version:
|
25
|
+
platform: ruby
|
26
|
+
signing_key:
|
27
|
+
cert_chain:
|
28
|
+
post_install_message:
|
29
|
+
authors:
|
30
|
+
- Jay Fields
|
31
|
+
files:
|
32
|
+
- lib/dust.rb
|
33
|
+
- test/all_tests.rb
|
34
|
+
- test/functional_test.rb
|
35
|
+
- test/test_helper.rb
|
36
|
+
- test/unit_test.rb
|
37
|
+
- rakefile.rb
|
38
|
+
- README
|
39
|
+
test_files:
|
40
|
+
- test/all_tests.rb
|
41
|
+
rdoc_options:
|
42
|
+
- --title
|
43
|
+
- Dust
|
44
|
+
- --main
|
45
|
+
- README
|
46
|
+
- --line-numbers
|
47
|
+
extra_rdoc_files:
|
48
|
+
- README
|
49
|
+
executables: []
|
50
|
+
|
51
|
+
extensions: []
|
52
|
+
|
53
|
+
requirements: []
|
54
|
+
|
55
|
+
dependencies: []
|
56
|
+
|