khelben-autotest-rails 4.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +23 -0
- data/History.txt +5 -0
- data/Manifest.txt +9 -0
- data/README.txt +49 -0
- data/Rakefile +55 -0
- data/VERSION +1 -0
- data/lib/autotest/discover.rb +5 -0
- data/lib/autotest/fixtures.rb +12 -0
- data/lib/autotest/migrate.rb +7 -0
- data/lib/autotest/rails.rb +82 -0
- metadata +73 -0
data/.autotest
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require 'autotest/restart'
|
4
|
+
|
5
|
+
# Autotest.add_hook :initialize do |at|
|
6
|
+
# at.extra_files << "../some/external/dependency.rb"
|
7
|
+
#
|
8
|
+
# at.libs << ":../some/external"
|
9
|
+
#
|
10
|
+
# at.add_exception 'vendor'
|
11
|
+
#
|
12
|
+
# at.add_mapping(/dependency.rb/) do |f, _|
|
13
|
+
# at.files_matching(/test_.*rb$/)
|
14
|
+
# end
|
15
|
+
#
|
16
|
+
# %w(TestA TestB).each do |klass|
|
17
|
+
# at.extra_class_map[klass] = "test/test_misc.rb"
|
18
|
+
# end
|
19
|
+
# end
|
20
|
+
|
21
|
+
# Autotest.add_hook :run_command do |at|
|
22
|
+
# system "rake build"
|
23
|
+
# end
|
data/History.txt
ADDED
data/Manifest.txt
ADDED
data/README.txt
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
= autotest-rails
|
2
|
+
|
3
|
+
* http://rubyforge.org/projects/zentest
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
This is an autotest plugin to provide rails support. It provides basic
|
8
|
+
rails support and extra plugins for migrations and fixtures.
|
9
|
+
|
10
|
+
== FEATURES/PROBLEMS:
|
11
|
+
|
12
|
+
* same old plugin you know and love. Just in its own package now.
|
13
|
+
|
14
|
+
== SYNOPSIS:
|
15
|
+
|
16
|
+
There is no synopsis. This just works.
|
17
|
+
|
18
|
+
== REQUIREMENTS:
|
19
|
+
|
20
|
+
* ZenTest for autotest
|
21
|
+
|
22
|
+
== INSTALL:
|
23
|
+
|
24
|
+
* sudo gem install autotest-rails
|
25
|
+
|
26
|
+
== LICENSE:
|
27
|
+
|
28
|
+
(The MIT License)
|
29
|
+
|
30
|
+
Copyright (c) 2009 Ryan Davis, seattle.rb
|
31
|
+
|
32
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
33
|
+
a copy of this software and associated documentation files (the
|
34
|
+
'Software'), to deal in the Software without restriction, including
|
35
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
36
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
37
|
+
permit persons to whom the Software is furnished to do so, subject to
|
38
|
+
the following conditions:
|
39
|
+
|
40
|
+
The above copyright notice and this permission notice shall be
|
41
|
+
included in all copies or substantial portions of the Software.
|
42
|
+
|
43
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
44
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
45
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
46
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
47
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
48
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
49
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
|
2
|
+
require 'rubygems'
|
3
|
+
require 'rake'
|
4
|
+
|
5
|
+
begin
|
6
|
+
require 'jeweler'
|
7
|
+
Jeweler::Tasks.new do |gem|
|
8
|
+
gem.version = "4.1.1"
|
9
|
+
gem.name = "khelben-autotest-rails"
|
10
|
+
gem.summary = %Q{autotest support for rails}
|
11
|
+
gem.description = %Q{This is my personal fork of the autotest-rails gem to reference autotest spin-off instead of the older ZenTest}
|
12
|
+
gem.email = "christiaan@oneye.be"
|
13
|
+
gem.homepage = "http://github.com/khelben/autotest-rails"
|
14
|
+
gem.authors = ["Christiaan Van den Poel"]
|
15
|
+
gem.add_runtime_dependency "autotest", "= 4.2.7"
|
16
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
17
|
+
end
|
18
|
+
Jeweler::GemcutterTasks.new
|
19
|
+
rescue LoadError
|
20
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
21
|
+
end
|
22
|
+
|
23
|
+
require 'rake/testtask'
|
24
|
+
Rake::TestTask.new(:test) do |test|
|
25
|
+
test.libs << 'lib' << 'test'
|
26
|
+
test.pattern = 'test/**/test_*.rb'
|
27
|
+
test.verbose = true
|
28
|
+
end
|
29
|
+
|
30
|
+
begin
|
31
|
+
require 'rcov/rcovtask'
|
32
|
+
Rcov::RcovTask.new do |test|
|
33
|
+
test.libs << 'test'
|
34
|
+
test.pattern = 'test/**/test_*.rb'
|
35
|
+
test.verbose = true
|
36
|
+
end
|
37
|
+
rescue LoadError
|
38
|
+
task :rcov do
|
39
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
task :test => :check_dependencies
|
44
|
+
|
45
|
+
task :default => :test
|
46
|
+
|
47
|
+
require 'rake/rdoctask'
|
48
|
+
Rake::RDocTask.new do |rdoc|
|
49
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
50
|
+
|
51
|
+
rdoc.rdoc_dir = 'rdoc'
|
52
|
+
rdoc.title = "test #{version}"
|
53
|
+
rdoc.rdoc_files.include('README*')
|
54
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
55
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.0
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
# This is an example of how to change the mappings of file that
|
4
|
+
# changed to tests to run for a project.
|
5
|
+
|
6
|
+
module Autotest::Fixtures
|
7
|
+
Autotest.add_hook :initialize do |at|
|
8
|
+
at.test_mappings['^test/fixtures/(.*)s.yml'] = proc { |filename, matches|
|
9
|
+
at.files_matching(/test\/\w+\/#{matches[1]}(_\w+)?.*_test.rb$/)
|
10
|
+
}
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
require 'autotest'
|
2
|
+
|
3
|
+
class Autotest::Rails < Autotest
|
4
|
+
VERSION = '4.1.0'
|
5
|
+
|
6
|
+
def initialize # :nodoc:
|
7
|
+
super
|
8
|
+
|
9
|
+
add_exception %r%^\./(?:db|doc|log|public|script|tmp|vendor)%
|
10
|
+
|
11
|
+
clear_mappings
|
12
|
+
|
13
|
+
self.add_mapping(/^lib\/.*\.rb$/) do |filename, _|
|
14
|
+
impl = File.basename(filename, '.rb')
|
15
|
+
files_matching %r%^test/unit/#{impl}_test.rb$%
|
16
|
+
# TODO: (unit|functional|integration) maybe?
|
17
|
+
end
|
18
|
+
|
19
|
+
add_mapping %r%^test/fixtures/(.*)s.yml% do |_, m|
|
20
|
+
["test/unit/#{m[1]}_test.rb",
|
21
|
+
"test/controllers/#{m[1]}_controller_test.rb",
|
22
|
+
"test/views/#{m[1]}_view_test.rb",
|
23
|
+
"test/functional/#{m[1]}_controller_test.rb"]
|
24
|
+
end
|
25
|
+
|
26
|
+
add_mapping %r%^test/(unit|integration|controllers|views|functional)/.*rb$% do |filename, _|
|
27
|
+
filename
|
28
|
+
end
|
29
|
+
|
30
|
+
add_mapping %r%^app/models/(.*)\.rb$% do |_, m|
|
31
|
+
"test/unit/#{m[1]}_test.rb"
|
32
|
+
end
|
33
|
+
|
34
|
+
add_mapping %r%^app/helpers/application_helper.rb% do
|
35
|
+
files_matching %r%^test/(views|functional)/.*_test\.rb$%
|
36
|
+
end
|
37
|
+
|
38
|
+
add_mapping %r%^app/helpers/(.*)_helper.rb% do |_, m|
|
39
|
+
if m[1] == "application" then
|
40
|
+
files_matching %r%^test/(views|functional)/.*_test\.rb$%
|
41
|
+
else
|
42
|
+
["test/views/#{m[1]}_view_test.rb",
|
43
|
+
"test/functional/#{m[1]}_controller_test.rb"]
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
add_mapping %r%^app/views/(.*)/% do |_, m|
|
48
|
+
["test/views/#{m[1]}_view_test.rb",
|
49
|
+
"test/functional/#{m[1]}_controller_test.rb"]
|
50
|
+
end
|
51
|
+
|
52
|
+
add_mapping %r%^app/controllers/(.*)\.rb$% do |_, m|
|
53
|
+
if m[1] == "application" then
|
54
|
+
files_matching %r%^test/(controllers|views|functional)/.*_test\.rb$%
|
55
|
+
else
|
56
|
+
["test/controllers/#{m[1]}_test.rb",
|
57
|
+
"test/functional/#{m[1]}_test.rb"]
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
add_mapping %r%^app/views/layouts/% do
|
62
|
+
"test/views/layouts_view_test.rb"
|
63
|
+
end
|
64
|
+
|
65
|
+
add_mapping %r%^config/routes.rb$% do # FIX:
|
66
|
+
files_matching %r%^test/(controllers|views|functional)/.*_test\.rb$%
|
67
|
+
end
|
68
|
+
|
69
|
+
add_mapping %r%^test/test_helper.rb|config/((boot|environment(s/test)?).rb|database.yml)% do
|
70
|
+
files_matching %r%^test/(unit|controllers|views|functional)/.*_test\.rb$%
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
# Convert the pathname s to the name of class.
|
75
|
+
def path_to_classname(s)
|
76
|
+
sep = File::SEPARATOR
|
77
|
+
f = s.sub(/^test#{sep}((unit|functional|integration|views|controllers|helpers)#{sep})?/, '').sub(/\.rb$/, '').split(sep)
|
78
|
+
f = f.map { |path| path.split(/_/).map { |seg| seg.capitalize }.join }
|
79
|
+
f = f.map { |path| path =~ /Test$/ ? path : "#{path}Test" }
|
80
|
+
f.join('::')
|
81
|
+
end
|
82
|
+
end
|
metadata
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: khelben-autotest-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 4.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Christiaan Van den Poel
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2010-02-19 00:00:00 +01:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: autotest
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - "="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 4.2.7
|
24
|
+
version:
|
25
|
+
description: This is my personal fork of the autotest-rails gem to reference autotest spin-off instead of the older ZenTest
|
26
|
+
email: christiaan@oneye.be
|
27
|
+
executables: []
|
28
|
+
|
29
|
+
extensions: []
|
30
|
+
|
31
|
+
extra_rdoc_files:
|
32
|
+
- README.txt
|
33
|
+
files:
|
34
|
+
- .autotest
|
35
|
+
- History.txt
|
36
|
+
- Manifest.txt
|
37
|
+
- README.txt
|
38
|
+
- Rakefile
|
39
|
+
- VERSION
|
40
|
+
- lib/autotest/discover.rb
|
41
|
+
- lib/autotest/fixtures.rb
|
42
|
+
- lib/autotest/migrate.rb
|
43
|
+
- lib/autotest/rails.rb
|
44
|
+
has_rdoc: true
|
45
|
+
homepage: http://github.com/khelben/autotest-rails
|
46
|
+
licenses: []
|
47
|
+
|
48
|
+
post_install_message:
|
49
|
+
rdoc_options:
|
50
|
+
- --charset=UTF-8
|
51
|
+
require_paths:
|
52
|
+
- lib
|
53
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: "0"
|
58
|
+
version:
|
59
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: "0"
|
64
|
+
version:
|
65
|
+
requirements: []
|
66
|
+
|
67
|
+
rubyforge_project:
|
68
|
+
rubygems_version: 1.3.5
|
69
|
+
signing_key:
|
70
|
+
specification_version: 3
|
71
|
+
summary: autotest support for rails
|
72
|
+
test_files: []
|
73
|
+
|