jcf-autotest-rails 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/History.txt +5 -0
- data/LICENSE +20 -0
- data/README.rdoc +17 -0
- data/Rakefile +57 -0
- data/VERSION +1 -0
- data/jcf-autotest-rails.gemspec +62 -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
- data/spec/autotest-rails_spec.rb +7 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +9 -0
- metadata +91 -0
data/.document
ADDED
data/.gitignore
ADDED
data/History.txt
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 James Conroy-Finn
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
= autotest-rails
|
2
|
+
|
3
|
+
Ryan Davis' autotest-rails, with some Jeweler magic and no ZenTest dependency.
|
4
|
+
|
5
|
+
== Note on Patches/Pull Requests
|
6
|
+
|
7
|
+
* Fork the project.
|
8
|
+
* Make your feature addition or bug fix.
|
9
|
+
* Add tests for it. This is important so I don't break it in a
|
10
|
+
future version unintentionally.
|
11
|
+
* Commit, do not mess with rakefile, version, or history.
|
12
|
+
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
13
|
+
* Send me a pull request. Bonus points for topic branches.
|
14
|
+
|
15
|
+
== Copyright
|
16
|
+
|
17
|
+
Copyright (c) 2010 Ryan Davis, seattle.rb. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "jcf-autotest-rails"
|
8
|
+
gem.summary = %Q{AutoTest Rails}
|
9
|
+
gem.description = %Q{AutoTest Rails without ZenTest}
|
10
|
+
gem.email = "james@logi.cl"
|
11
|
+
gem.homepage = "http://github.com/jcf/autotest-rails"
|
12
|
+
gem.authors = ["Ryan Davis", "James Conroy-Finn"]
|
13
|
+
gem.add_dependency "autotest"
|
14
|
+
gem.add_development_dependency "rspec", ">= 1.2.9"
|
15
|
+
end
|
16
|
+
Jeweler::GemcutterTasks.new
|
17
|
+
rescue LoadError
|
18
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
19
|
+
end
|
20
|
+
|
21
|
+
require 'spec/rake/spectask'
|
22
|
+
Spec::Rake::SpecTask.new(:spec) do |spec|
|
23
|
+
spec.libs << 'lib' << 'spec'
|
24
|
+
spec.spec_files = FileList['spec/**/*_spec.rb']
|
25
|
+
end
|
26
|
+
|
27
|
+
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
28
|
+
spec.libs << 'lib' << 'spec'
|
29
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
30
|
+
spec.rcov = true
|
31
|
+
end
|
32
|
+
|
33
|
+
task :spec => :check_dependencies
|
34
|
+
|
35
|
+
begin
|
36
|
+
require 'roodi'
|
37
|
+
require 'roodi_task'
|
38
|
+
RoodiTask.new do |t|
|
39
|
+
t.verbose = false
|
40
|
+
end
|
41
|
+
rescue LoadError
|
42
|
+
task :roodi do
|
43
|
+
abort "Roodi is not available. In order to run roodi, you must: sudo gem install roodi"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
task :default => :spec
|
48
|
+
|
49
|
+
require 'rake/rdoctask'
|
50
|
+
Rake::RDocTask.new do |rdoc|
|
51
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
52
|
+
|
53
|
+
rdoc.rdoc_dir = 'rdoc'
|
54
|
+
rdoc.title = "autotest-rails #{version}"
|
55
|
+
rdoc.rdoc_files.include('README*')
|
56
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
57
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.1
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{jcf-autotest-rails}
|
8
|
+
s.version = "0.0.1"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Ryan Davis", "James Conroy-Finn"]
|
12
|
+
s.date = %q{2010-02-19}
|
13
|
+
s.description = %q{AutoTest Rails without ZenTest}
|
14
|
+
s.email = %q{james@logi.cl}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".gitignore",
|
22
|
+
"History.txt",
|
23
|
+
"LICENSE",
|
24
|
+
"README.rdoc",
|
25
|
+
"Rakefile",
|
26
|
+
"VERSION",
|
27
|
+
"jcf-autotest-rails.gemspec",
|
28
|
+
"lib/autotest/discover.rb",
|
29
|
+
"lib/autotest/fixtures.rb",
|
30
|
+
"lib/autotest/migrate.rb",
|
31
|
+
"lib/autotest/rails.rb",
|
32
|
+
"spec/autotest-rails_spec.rb",
|
33
|
+
"spec/spec.opts",
|
34
|
+
"spec/spec_helper.rb"
|
35
|
+
]
|
36
|
+
s.homepage = %q{http://github.com/jcf/autotest-rails}
|
37
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
38
|
+
s.require_paths = ["lib"]
|
39
|
+
s.rubygems_version = %q{1.3.5}
|
40
|
+
s.summary = %q{AutoTest Rails}
|
41
|
+
s.test_files = [
|
42
|
+
"spec/autotest-rails_spec.rb",
|
43
|
+
"spec/spec_helper.rb"
|
44
|
+
]
|
45
|
+
|
46
|
+
if s.respond_to? :specification_version then
|
47
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
48
|
+
s.specification_version = 3
|
49
|
+
|
50
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
51
|
+
s.add_runtime_dependency(%q<autotest>, [">= 0"])
|
52
|
+
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
53
|
+
else
|
54
|
+
s.add_dependency(%q<autotest>, [">= 0"])
|
55
|
+
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
56
|
+
end
|
57
|
+
else
|
58
|
+
s.add_dependency(%q<autotest>, [">= 0"])
|
59
|
+
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
@@ -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
|
data/spec/spec.opts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jcf-autotest-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ryan Davis
|
8
|
+
- James Conroy-Finn
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2010-02-19 00:00:00 +00:00
|
14
|
+
default_executable:
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: autotest
|
18
|
+
type: :runtime
|
19
|
+
version_requirement:
|
20
|
+
version_requirements: !ruby/object:Gem::Requirement
|
21
|
+
requirements:
|
22
|
+
- - ">="
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: "0"
|
25
|
+
version:
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: rspec
|
28
|
+
type: :development
|
29
|
+
version_requirement:
|
30
|
+
version_requirements: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 1.2.9
|
35
|
+
version:
|
36
|
+
description: AutoTest Rails without ZenTest
|
37
|
+
email: james@logi.cl
|
38
|
+
executables: []
|
39
|
+
|
40
|
+
extensions: []
|
41
|
+
|
42
|
+
extra_rdoc_files:
|
43
|
+
- LICENSE
|
44
|
+
- README.rdoc
|
45
|
+
files:
|
46
|
+
- .document
|
47
|
+
- .gitignore
|
48
|
+
- History.txt
|
49
|
+
- LICENSE
|
50
|
+
- README.rdoc
|
51
|
+
- Rakefile
|
52
|
+
- VERSION
|
53
|
+
- jcf-autotest-rails.gemspec
|
54
|
+
- lib/autotest/discover.rb
|
55
|
+
- lib/autotest/fixtures.rb
|
56
|
+
- lib/autotest/migrate.rb
|
57
|
+
- lib/autotest/rails.rb
|
58
|
+
- spec/autotest-rails_spec.rb
|
59
|
+
- spec/spec.opts
|
60
|
+
- spec/spec_helper.rb
|
61
|
+
has_rdoc: true
|
62
|
+
homepage: http://github.com/jcf/autotest-rails
|
63
|
+
licenses: []
|
64
|
+
|
65
|
+
post_install_message:
|
66
|
+
rdoc_options:
|
67
|
+
- --charset=UTF-8
|
68
|
+
require_paths:
|
69
|
+
- lib
|
70
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: "0"
|
75
|
+
version:
|
76
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: "0"
|
81
|
+
version:
|
82
|
+
requirements: []
|
83
|
+
|
84
|
+
rubyforge_project:
|
85
|
+
rubygems_version: 1.3.5
|
86
|
+
signing_key:
|
87
|
+
specification_version: 3
|
88
|
+
summary: AutoTest Rails
|
89
|
+
test_files:
|
90
|
+
- spec/autotest-rails_spec.rb
|
91
|
+
- spec/spec_helper.rb
|