semaperepelitsa-autotest-rails 4.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -0,0 +1,11 @@
1
+ === 4.1.1 / 2011-09-21
2
+
3
+ * 1 minor enhancement:
4
+
5
+ * #path_to_classname can test non-standard rails directories (apotonick)
6
+
7
+ === 4.1.0 / 2009-06-03
8
+
9
+ * 1 major enhancement
10
+
11
+ * Birthday! well... split from ZenTest
@@ -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
@@ -0,0 +1,50 @@
1
+ = autotest-rails
2
+
3
+ home :: https://github.com/seattlerb/autotest-rails
4
+ rdoc :: http://zentest.rubyforge.org/autotest-rails
5
+
6
+ == DESCRIPTION:
7
+
8
+ This is an autotest plugin to provide rails support. It provides basic
9
+ rails support and extra plugins for migrations and fixtures.
10
+
11
+ == FEATURES/PROBLEMS:
12
+
13
+ * same old plugin you know and love. Just in its own package now.
14
+
15
+ == SYNOPSIS:
16
+
17
+ There is no synopsis. This just works.
18
+
19
+ == REQUIREMENTS:
20
+
21
+ * ZenTest for autotest
22
+
23
+ == INSTALL:
24
+
25
+ * sudo gem install autotest-rails
26
+
27
+ == LICENSE:
28
+
29
+ (The MIT License)
30
+
31
+ Copyright (c) Ryan Davis, seattle.rb
32
+
33
+ Permission is hereby granted, free of charge, to any person obtaining
34
+ a copy of this software and associated documentation files (the
35
+ 'Software'), to deal in the Software without restriction, including
36
+ without limitation the rights to use, copy, modify, merge, publish,
37
+ distribute, sublicense, and/or sell copies of the Software, and to
38
+ permit persons to whom the Software is furnished to do so, subject to
39
+ the following conditions:
40
+
41
+ The above copyright notice and this permission notice shall be
42
+ included in all copies or substantial portions of the Software.
43
+
44
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
45
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
46
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
47
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
48
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
49
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
50
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,14 @@
1
+ # -*- ruby -*-
2
+
3
+ require 'rubygems'
4
+ require 'hoe'
5
+
6
+ Hoe.spec 'semaperepelitsa-autotest-rails' do
7
+ developer('Ryan Davis', 'ryand-ruby@zenspider.com')
8
+
9
+ self.rubyforge_name = 'zentest'
10
+
11
+ dependency "ZenTest", "~> 4.5"
12
+ end
13
+
14
+ # vim: syntax=ruby
@@ -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,82 @@
1
+ require 'autotest'
2
+
3
+ class Autotest::Rails < Autotest
4
+ VERSION = '4.1.2'
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}((\w+)#{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,94 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: semaperepelitsa-autotest-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 4.1.2
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Ryan Davis
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-02-11 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: ZenTest
16
+ requirement: &70125238057560 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '4.5'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70125238057560
25
+ - !ruby/object:Gem::Dependency
26
+ name: rdoc
27
+ requirement: &70125238057140 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: '3.10'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *70125238057140
36
+ - !ruby/object:Gem::Dependency
37
+ name: hoe
38
+ requirement: &70125238056720 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ version: '2.12'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *70125238056720
47
+ description: ! 'This is an autotest plugin to provide rails support. It provides basic
48
+
49
+ rails support and extra plugins for migrations and fixtures.'
50
+ email:
51
+ - ryand-ruby@zenspider.com
52
+ executables: []
53
+ extensions: []
54
+ extra_rdoc_files:
55
+ - History.txt
56
+ - Manifest.txt
57
+ - README.txt
58
+ files:
59
+ - .autotest
60
+ - History.txt
61
+ - Manifest.txt
62
+ - README.txt
63
+ - Rakefile
64
+ - lib/autotest/discover.rb
65
+ - lib/autotest/fixtures.rb
66
+ - lib/autotest/migrate.rb
67
+ - lib/autotest/rails.rb
68
+ homepage: https://github.com/seattlerb/autotest-rails
69
+ licenses: []
70
+ post_install_message:
71
+ rdoc_options:
72
+ - --main
73
+ - README.txt
74
+ require_paths:
75
+ - lib
76
+ required_ruby_version: !ruby/object:Gem::Requirement
77
+ none: false
78
+ requirements:
79
+ - - ! '>='
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ requirements: []
89
+ rubyforge_project: zentest
90
+ rubygems_version: 1.8.15
91
+ signing_key:
92
+ specification_version: 3
93
+ summary: This is an autotest plugin to provide rails support
94
+ test_files: []