autotest-rails-pure 4.1.0 → 4.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,3 +1,11 @@
1
+ require 'rubygems'
2
+ require 'rake/testtask'
3
+
4
+ task :default => :test
5
+ Rake::TestTask.new(:test) do |test|
6
+ test.test_files = FileList['test/*.rb']
7
+ end
8
+
1
9
  begin
2
10
  require 'jeweler'
3
11
  Jeweler::Tasks.new do |gem|
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.1.0
1
+ 4.1.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{autotest-rails-pure}
8
- s.version = "4.1.0"
8
+ s.version = "4.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ryan Davis"]
12
- s.date = %q{2010-02-11}
12
+ s.date = %q{2010-11-07}
13
13
  s.extra_rdoc_files = [
14
14
  "README.markdown"
15
15
  ]
@@ -23,19 +23,23 @@ Gem::Specification.new do |s|
23
23
  "lib/autotest/discover.rb",
24
24
  "lib/autotest/fixtures.rb",
25
25
  "lib/autotest/migrate.rb",
26
- "lib/autotest/rails.rb"
26
+ "lib/autotest/rails.rb",
27
+ "test/rails_test.rb"
27
28
  ]
28
29
  s.homepage = %q{http://github.com/grosser/autotest-rails}
29
30
  s.rdoc_options = ["--charset=UTF-8"]
30
31
  s.require_paths = ["lib"]
31
- s.rubygems_version = %q{1.3.5}
32
+ s.rubygems_version = %q{1.3.7}
32
33
  s.summary = %q{Autotest for Test::Unit on Rails, including plugins for migrations and fixtures.}
34
+ s.test_files = [
35
+ "test/rails_test.rb"
36
+ ]
33
37
 
34
38
  if s.respond_to? :specification_version then
35
39
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
36
40
  s.specification_version = 3
37
41
 
38
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
42
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
39
43
  else
40
44
  end
41
45
  else
@@ -71,12 +71,16 @@ class Autotest::Rails < Autotest
71
71
  end
72
72
  end
73
73
 
74
+ def ignored_namespaces
75
+ 'unit|functional|integration|views|controllers|helpers|cells'
76
+ end
77
+
74
78
  # Convert the pathname s to the name of class.
75
79
  def path_to_classname(s)
76
80
  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
+ parts = s.sub(/^test#{sep}((#{ignored_namespaces})#{sep})?/, '').sub(/\.rb$/, '').split(sep)
82
+ modules = parts.map { |path| path.split(/_/).map { |seg| seg.capitalize }.join }
83
+ modules = modules.map { |path| path =~ /Test$/ ? path : "#{path}Test" }
84
+ modules.join('::')
81
85
  end
82
86
  end
@@ -0,0 +1,26 @@
1
+ require 'rubygems'
2
+ require "minitest/autorun"
3
+ require "autotest/rails"
4
+
5
+ class RailsTest < MiniTest::Unit::TestCase
6
+ describe Autotest::Rails do
7
+ before do
8
+ @at = Autotest::Rails.new
9
+ end
10
+
11
+ describe "#path_to_classname" do
12
+ it "should ignore default namespaces" do
13
+ assert_equal "PostControllerTest", @at.path_to_classname("test/controllers/post_controller_test.rb")
14
+ assert_equal "PostCellTest", @at.path_to_classname("test/cells/post_cell_test.rb")
15
+ end
16
+
17
+ it "should convert non-default namespaces" do
18
+ assert_equal "FooTest::PostControllerTest", @at.path_to_classname("test/foo/post_controller_test.rb")
19
+ end
20
+
21
+ it "should convert normal namespaces inside ignored namespaces" do
22
+ assert_equal "BloggingTest::PostControllerTest", @at.path_to_classname("test/controllers/blogging/post_controller_test.rb")
23
+ end
24
+ end
25
+ end
26
+ end
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autotest-rails-pure
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ hash: 57
5
+ prerelease: false
6
+ segments:
7
+ - 4
8
+ - 1
9
+ - 1
10
+ version: 4.1.1
5
11
  platform: ruby
6
12
  authors:
7
13
  - Ryan Davis
@@ -9,7 +15,7 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2010-02-11 00:00:00 +01:00
18
+ date: 2010-11-07 00:00:00 +01:00
13
19
  default_executable:
14
20
  dependencies: []
15
21
 
@@ -32,6 +38,7 @@ files:
32
38
  - lib/autotest/fixtures.rb
33
39
  - lib/autotest/migrate.rb
34
40
  - lib/autotest/rails.rb
41
+ - test/rails_test.rb
35
42
  has_rdoc: true
36
43
  homepage: http://github.com/grosser/autotest-rails
37
44
  licenses: []
@@ -42,23 +49,29 @@ rdoc_options:
42
49
  require_paths:
43
50
  - lib
44
51
  required_ruby_version: !ruby/object:Gem::Requirement
52
+ none: false
45
53
  requirements:
46
54
  - - ">="
47
55
  - !ruby/object:Gem::Version
56
+ hash: 3
57
+ segments:
58
+ - 0
48
59
  version: "0"
49
- version:
50
60
  required_rubygems_version: !ruby/object:Gem::Requirement
61
+ none: false
51
62
  requirements:
52
63
  - - ">="
53
64
  - !ruby/object:Gem::Version
65
+ hash: 3
66
+ segments:
67
+ - 0
54
68
  version: "0"
55
- version:
56
69
  requirements: []
57
70
 
58
71
  rubyforge_project:
59
- rubygems_version: 1.3.5
72
+ rubygems_version: 1.3.7
60
73
  signing_key:
61
74
  specification_version: 3
62
75
  summary: Autotest for Test::Unit on Rails, including plugins for migrations and fixtures.
63
- test_files: []
64
-
76
+ test_files:
77
+ - test/rails_test.rb