tastyhat-autotest-rails 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ *.sw?
2
+ .DS_Store
3
+ coverage
4
+ rdoc
5
+ pkg
data/History.txt ADDED
@@ -0,0 +1,5 @@
1
+ === 4.1.0 / 2009-06-03
2
+
3
+ * 1 major enhancement
4
+
5
+ * Birthday! well... split from ZenTest
data/Manifest.txt ADDED
@@ -0,0 +1,9 @@
1
+ .autotest
2
+ History.txt
3
+ Manifest.txt
4
+ README.txt
5
+ Rakefile
6
+ lib/autotest/discover.rb
7
+ lib/autotest/fixtures.rb
8
+ lib/autotest/migrate.rb
9
+ lib/autotest/rails.rb
data/README.txt ADDED
@@ -0,0 +1,51 @@
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
+ Added: support for machinist/factory_girl, and support for folders under lib being mapped properly.
11
+
12
+ == FEATURES/PROBLEMS:
13
+
14
+ * same old plugin you know and love. Just in its own package now.
15
+
16
+ == SYNOPSIS:
17
+
18
+ There is no synopsis. This just works.
19
+
20
+ == REQUIREMENTS:
21
+
22
+ * ZenTest for autotest
23
+
24
+ == INSTALL:
25
+
26
+ * sudo gem install autotest-rails
27
+
28
+ == LICENSE:
29
+
30
+ (The MIT License)
31
+
32
+ Copyright (c) 2009 Ryan Davis, seattle.rb
33
+
34
+ Permission is hereby granted, free of charge, to any person obtaining
35
+ a copy of this software and associated documentation files (the
36
+ 'Software'), to deal in the Software without restriction, including
37
+ without limitation the rights to use, copy, modify, merge, publish,
38
+ distribute, sublicense, and/or sell copies of the Software, and to
39
+ permit persons to whom the Software is furnished to do so, subject to
40
+ the following conditions:
41
+
42
+ The above copyright notice and this permission notice shall be
43
+ included in all copies or substantial portions of the Software.
44
+
45
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
46
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
47
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
48
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
49
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
50
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
51
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,71 @@
1
+ # # -*- ruby -*-
2
+ #
3
+ # require 'rubygems'
4
+ # require 'hoe'
5
+ #
6
+ # Hoe.spec 'autotest-rails' do
7
+ # developer('Ryan Davis', 'ryand-ruby@zenspider.com')
8
+ #
9
+ # self.rubyforge_name = 'zentest'
10
+ #
11
+ # extra_deps << 'ZenTest'
12
+ # end
13
+ #
14
+ # # vim: syntax=ruby
15
+
16
+ require 'rubygems'
17
+ require 'rake'
18
+
19
+ begin
20
+ require 'jeweler'
21
+ Jeweler::Tasks.new do |gem|
22
+ gem.name = "autotest-rails"
23
+ gem.summary = %Q{Autotest mapping for rails}
24
+ gem.description = %Q{Autotest mapping for rails/factory_girl/machinist}
25
+ gem.email = "tastyhat@jamesstuart.org"
26
+ gem.homepage = "http://github.com/tastyhat/autotest-rails"
27
+ gem.authors = ["James Stuart"]
28
+ gem.add_development_dependency "thoughtbot-shoulda"
29
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
30
+ end
31
+ rescue LoadError
32
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
33
+ end
34
+
35
+ require 'rake/testtask'
36
+ Rake::TestTask.new(:test) do |test|
37
+ test.libs << 'lib' << 'test'
38
+ test.pattern = 'test/**/*_test.rb'
39
+ test.verbose = true
40
+ end
41
+
42
+ begin
43
+ require 'rcov/rcovtask'
44
+ Rcov::RcovTask.new do |test|
45
+ test.libs << 'test'
46
+ test.pattern = 'test/**/*_test.rb'
47
+ test.verbose = true
48
+ end
49
+ rescue LoadError
50
+ task :rcov do
51
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
52
+ end
53
+ end
54
+
55
+ task :test => :check_dependencies
56
+
57
+ task :default => :test
58
+
59
+ require 'rake/rdoctask'
60
+ Rake::RDocTask.new do |rdoc|
61
+ if File.exist?('VERSION')
62
+ version = File.read('VERSION')
63
+ else
64
+ version = ""
65
+ end
66
+
67
+ rdoc.rdoc_dir = 'rdoc'
68
+ rdoc.title = "cul-fedora-arm #{version}"
69
+ rdoc.rdoc_files.include('README*')
70
+ rdoc.rdoc_files.include('lib/**/*.rb')
71
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 4.2.0
@@ -0,0 +1,50 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{autotest-rails}
8
+ s.version = "4.2.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["James Stuart"]
12
+ s.date = %q{2009-08-25}
13
+ s.description = %q{Autotest mapping for rails/factory_girl/machinist}
14
+ s.email = %q{tastyhat@jamesstuart.org}
15
+ s.extra_rdoc_files = [
16
+ "README.txt"
17
+ ]
18
+ s.files = [
19
+ ".autotest",
20
+ ".gitignore",
21
+ "History.txt",
22
+ "Manifest.txt",
23
+ "README.txt",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "autotest-rails.gemspec",
27
+ "lib/autotest/discover.rb",
28
+ "lib/autotest/fixtures.rb",
29
+ "lib/autotest/migrate.rb",
30
+ "lib/autotest/rails.rb"
31
+ ]
32
+ s.homepage = %q{http://github.com/tastyhat/autotest-rails}
33
+ s.rdoc_options = ["--charset=UTF-8"]
34
+ s.require_paths = ["lib"]
35
+ s.rubygems_version = %q{1.3.5}
36
+ s.summary = %q{Autotest mapping for rails}
37
+
38
+ if s.respond_to? :specification_version then
39
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
40
+ s.specification_version = 3
41
+
42
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
43
+ s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
44
+ else
45
+ s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
46
+ end
47
+ else
48
+ s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
49
+ end
50
+ end
@@ -0,0 +1,5 @@
1
+ Autotest.add_discovery do
2
+ style = []
3
+ style << "rails" if File.exist? 'config/environment.rb'
4
+ style
5
+ end
@@ -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,7 @@
1
+ # -*- ruby -*-
2
+
3
+ module Autotest::Migrate
4
+ Autotest.add_hook(:run) do |autotest|
5
+ system "rake db:migrate" if autotest.class.to_s == "RailsAutotest"
6
+ end
7
+ end
@@ -0,0 +1,95 @@
1
+ require 'autotest'
2
+
3
+ class Autotest::Rails < Autotest
4
+ def initialize # :nodoc:
5
+ super
6
+
7
+ add_exception %r%^\./(?:db|doc|log|public|script|tmp|vendor)%
8
+
9
+ clear_mappings
10
+
11
+ add_mapping %r%^lib/(.*)\.rb$% do |_, m|
12
+ ["test/unit/#{m[1].gsub(/\//,"_")}_test.rb"]
13
+ end
14
+
15
+
16
+
17
+ add_mapping %r%^test/factories/(.*)_factory.rb% do |_, m|
18
+ ["test/unit/#{m[1]}_test.rb",
19
+ "test/controllers/#{m[1]}_controller_test.rb",
20
+ "test/views/#{m[1]}_view_test.rb",
21
+ "test/functional/#{m[1]}_controller_test.rb"]
22
+ end
23
+
24
+
25
+
26
+ # self.add_mapping(/^lib\/.*\.rb$/) do |filename, _|
27
+ # impl = File.basename(filename, '.rb')
28
+ # files_matching %r%^test/unit/#{impl}_test.rb$%
29
+ # # TODO: (unit|functional|integration) maybe?
30
+ # end
31
+
32
+ add_mapping %r%^test/fixtures/(.*)s.yml% do |_, m|
33
+ ["test/unit/#{m[1]}_test.rb",
34
+ "test/controllers/#{m[1]}_controller_test.rb",
35
+ "test/views/#{m[1]}_view_test.rb",
36
+ "test/functional/#{m[1]}_controller_test.rb"]
37
+ end
38
+
39
+ add_mapping %r%^test/(unit|integration|controllers|views|functional)/.*rb$% do |filename, _|
40
+ filename
41
+ end
42
+
43
+ add_mapping %r%^app/models/(.*)\.rb$% do |_, m|
44
+ "test/unit/#{m[1]}_test.rb"
45
+ end
46
+
47
+ add_mapping %r%^app/helpers/application_helper.rb% do
48
+ files_matching %r%^test/(views|functional)/.*_test\.rb$%
49
+ end
50
+
51
+ add_mapping %r%^app/helpers/(.*)_helper.rb% do |_, m|
52
+ if m[1] == "application" then
53
+ files_matching %r%^test/(views|functional)/.*_test\.rb$%
54
+ else
55
+ ["test/views/#{m[1]}_view_test.rb",
56
+ "test/functional/#{m[1]}_controller_test.rb"]
57
+ end
58
+ end
59
+
60
+ add_mapping %r%^app/views/(.*)/% do |_, m|
61
+ ["test/views/#{m[1]}_view_test.rb",
62
+ "test/functional/#{m[1]}_controller_test.rb"]
63
+ end
64
+
65
+ add_mapping %r%^app/controllers/(.*)\.rb$% do |_, m|
66
+ if m[1] == "application" then
67
+ files_matching %r%^test/(controllers|views|functional)/.*_test\.rb$%
68
+ else
69
+ ["test/controllers/#{m[1]}_test.rb",
70
+ "test/functional/#{m[1]}_test.rb"]
71
+ end
72
+ end
73
+
74
+ add_mapping %r%^app/views/layouts/% do
75
+ "test/views/layouts_view_test.rb"
76
+ end
77
+
78
+ add_mapping %r%^config/routes.rb$% do # FIX:
79
+ files_matching %r%^test/(controllers|views|functional)/.*_test\.rb$%
80
+ end
81
+
82
+ add_mapping %r%^test/factories.rb|test/blueprints.rb|test/test_helper.rb|config/((boot|environment(s/test)?).rb|database.yml)% do
83
+ files_matching %r%^test/(unit|controllers|views|functional)/.*_test\.rb$%
84
+ end
85
+ end
86
+
87
+ # Convert the pathname s to the name of class.
88
+ def path_to_classname(s)
89
+ sep = File::SEPARATOR
90
+ f = s.sub(/^test#{sep}((unit|functional|integration|views|controllers|helpers)#{sep})?/, '').sub(/\.rb$/, '').split(sep)
91
+ f = f.map { |path| path.split(/_/).map { |seg| seg.capitalize }.join }
92
+ f = f.map { |path| path =~ /Test$/ ? path : "#{path}Test" }
93
+ f.join('::')
94
+ end
95
+ end
metadata ADDED
@@ -0,0 +1,74 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tastyhat-autotest-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 4.2.0
5
+ platform: ruby
6
+ authors:
7
+ - James Stuart
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-08-25 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: thoughtbot-shoulda
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ description: Autotest mapping for rails/factory_girl/machinist
26
+ email: tastyhat@jamesstuart.org
27
+ executables: []
28
+
29
+ extensions: []
30
+
31
+ extra_rdoc_files:
32
+ - README.txt
33
+ files:
34
+ - .autotest
35
+ - .gitignore
36
+ - History.txt
37
+ - Manifest.txt
38
+ - README.txt
39
+ - Rakefile
40
+ - VERSION
41
+ - autotest-rails.gemspec
42
+ - lib/autotest/discover.rb
43
+ - lib/autotest/fixtures.rb
44
+ - lib/autotest/migrate.rb
45
+ - lib/autotest/rails.rb
46
+ has_rdoc: false
47
+ homepage: http://github.com/tastyhat/autotest-rails
48
+ licenses:
49
+ post_install_message:
50
+ rdoc_options:
51
+ - --charset=UTF-8
52
+ require_paths:
53
+ - lib
54
+ required_ruby_version: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: "0"
59
+ version:
60
+ required_rubygems_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: "0"
65
+ version:
66
+ requirements: []
67
+
68
+ rubyforge_project:
69
+ rubygems_version: 1.3.5
70
+ signing_key:
71
+ specification_version: 3
72
+ summary: Autotest mapping for rails
73
+ test_files: []
74
+