generator-spec 0.5.0 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. data/.document +0 -0
  2. data/.gitignore +0 -0
  3. data/.rspec +0 -0
  4. data/LICENSE +0 -0
  5. data/README.markdown +19 -13
  6. data/Rakefile +14 -35
  7. data/VERSION +1 -1
  8. data/generator-spec.gemspec +63 -148
  9. data/lib/generator-spec.rb +12 -0
  10. data/lib/generator-spec/namespaces.rb +7 -0
  11. data/lib/{generator_spec/helpers/configure_rails.rb → generator-spec/rails/configure.rb} +3 -3
  12. data/lib/generator-spec/rspec.rb +1 -0
  13. data/lib/generator-spec/rspec/configure.rb +6 -0
  14. data/lib/{generator_spec/rspec_generator/generator_util.rb → generator-spec/rspec/generator.rb} +6 -6
  15. data/lib/{generator_spec/rspec_generator → generator-spec/rspec/generator}/configure.rb +0 -0
  16. data/lib/{generator_spec/require_generator.rb → generator-spec/rspec/generator/require.rb} +0 -0
  17. data/lib/{generator_spec/rspec_generator → generator-spec/rspec/generator}/routes.rb +0 -0
  18. data/lib/{generator_spec/rspec_generator → generator-spec/rspec/generator}/test_case.rb +0 -0
  19. data/lib/generator-spec/rspec/macro.rb +18 -0
  20. data/lib/generator-spec/rspec/matchers/generate_artifact.rb +34 -0
  21. data/lib/generator-spec/rspec/matchers/generate_artifacts.rb +33 -0
  22. data/lib/generators/controller/controller_generator.rb +15 -21
  23. data/lib/generators/helper/helper_generator.rb +13 -29
  24. data/lib/generators/migration/migration_generator.rb +6 -7
  25. data/lib/generators/migration/templates/create_users.erb +0 -0
  26. data/lib/generators/model/model_generator.rb +36 -55
  27. data/lib/generators/observer/observer_generator.rb +2 -0
  28. data/lib/generators/view/view_generator.rb +2 -0
  29. data/spec/generator_spec/generators/controller_gen_spec.rb +40 -0
  30. data/spec/generator_spec/generators/{helper_generator_spec.rb → helper_gen_spec.rb} +4 -8
  31. data/spec/generator_spec/generators/{migration_generator_spec.rb → migration_gen_spec.rb} +3 -8
  32. data/spec/generator_spec/generators/model_gen_spec.rb +36 -0
  33. data/spec/generator_spec/generators/{observer_generator_spec.rb → observer_gen_spec.rb} +12 -21
  34. data/spec/generator_spec/generators/{view_generator_spec.rb → view_gen_spec.rb} +9 -20
  35. data/spec/generator_spec/matchers/generate_artifact_spec.rb +36 -0
  36. data/spec/generator_spec/matchers/generate_artifacts_spec.rb +35 -0
  37. data/spec/spec_helper.rb +5 -6
  38. data/wiki/Custom Rails 3 Generators.textile b/data/wiki/Custom Rails 3 → Generators.textile +0 -0
  39. data/wiki/content_matchers.textile +0 -0
  40. data/wiki/file_matchers.textile +0 -0
  41. data/wiki/migration_matchers.textile +0 -0
  42. data/wiki/rails_helpers.textile +0 -0
  43. metadata +117 -154
  44. data/lib/generator_spec.rb +0 -12
  45. data/lib/generator_spec/extensions/core_ext.rb +0 -47
  46. data/lib/generator_spec/helpers/generator_helper.rb +0 -11
  47. data/lib/generator_spec/helpers/migration_helper.rb +0 -69
  48. data/lib/generator_spec/main.rb +0 -77
  49. data/lib/generator_spec/matchers/content/content_matcher.rb +0 -110
  50. data/lib/generator_spec/matchers/content/have_block.rb +0 -57
  51. data/lib/generator_spec/matchers/content/have_call.rb +0 -59
  52. data/lib/generator_spec/matchers/content/have_calls.rb +0 -60
  53. data/lib/generator_spec/matchers/content/have_class_self.rb +0 -40
  54. data/lib/generator_spec/matchers/content/have_comment.rb +0 -42
  55. data/lib/generator_spec/matchers/content/have_method.rb +0 -66
  56. data/lib/generator_spec/matchers/content/have_module.rb +0 -66
  57. data/lib/generator_spec/matchers/content/have_region.rb +0 -48
  58. data/lib/generator_spec/matchers/content/have_subclass.rb +0 -50
  59. data/lib/generator_spec/matchers/content/include_module.rb +0 -51
  60. data/lib/generator_spec/matchers/content/inherit_from.rb +0 -40
  61. data/lib/generator_spec/matchers/file/generate_directory.rb +0 -73
  62. data/lib/generator_spec/matchers/file/generate_file.rb +0 -103
  63. data/lib/generator_spec/matchers/file/generate_migration.rb +0 -54
  64. data/lib/generator_spec/matchers/file/have_file.rb +0 -115
  65. data/lib/generator_spec/matchers/helpers/content.rb +0 -18
  66. data/lib/generator_spec/matchers/helpers/file.rb +0 -26
  67. data/lib/generator_spec/matchers/helpers/migration.rb +0 -89
  68. data/lib/generator_spec/matchers/migration/have_column.rb +0 -29
  69. data/lib/generator_spec/matchers/migration/have_index.rb +0 -9
  70. data/lib/generator_spec/matchers/migration/have_table.rb +0 -18
  71. data/lib/generator_spec/matchers/migration/have_tbl_column.rb +0 -25
  72. data/lib/generator_spec/matchers/migration/have_up_down.rb +0 -15
  73. data/lib/generator_spec/rails_helpers/base_helper.rb +0 -171
  74. data/lib/generator_spec/rails_helpers/rails_app.rb +0 -166
  75. data/lib/generator_spec/rails_helpers/rails_controller.rb +0 -44
  76. data/lib/generator_spec/rails_helpers/rails_helper.rb +0 -40
  77. data/lib/generator_spec/rails_helpers/rails_mailer.rb +0 -39
  78. data/lib/generator_spec/rails_helpers/rails_migration.rb +0 -51
  79. data/lib/generator_spec/rails_helpers/rails_model.rb +0 -40
  80. data/lib/generator_spec/rails_helpers/rails_observer.rb +0 -39
  81. data/lib/generator_spec/rails_helpers/rails_orm.rb +0 -114
  82. data/lib/generator_spec/rails_helpers/rails_view.rb +0 -65
  83. data/rspec_for_generators.gemspec +0 -96
  84. data/spec/generator_spec/generators/controller_generator_spec.rb +0 -47
  85. data/spec/generator_spec/generators/model_generator_spec.rb +0 -41
  86. data/spec/generator_spec/matchers/content/class_self_spec.rb +0 -30
  87. data/spec/generator_spec/matchers/content/have_block_spec.rb +0 -57
  88. data/spec/generator_spec/matchers/content/have_call_spec.rb +0 -55
  89. data/spec/generator_spec/matchers/content/have_calls_spec.rb +0 -47
  90. data/spec/generator_spec/matchers/content/have_class_spec.rb +0 -34
  91. data/spec/generator_spec/matchers/content/have_method_spec.rb +0 -52
  92. data/spec/generator_spec/matchers/content/have_module_spec.rb +0 -34
  93. data/spec/generator_spec/matchers/content/have_region_spec.rb +0 -56
  94. data/spec/generator_spec/matchers/content/have_subclass_spec.rb +0 -34
  95. data/spec/generator_spec/matchers/content/include_module_spec.rb +0 -36
  96. data/spec/generator_spec/matchers/content/inherit_from_spec.rb +0 -34
  97. data/spec/generator_spec/matchers/file/directory_spec.rb +0 -0
  98. data/spec/generator_spec/matchers/file/file_spec.rb +0 -0
  99. data/spec/generator_spec/matchers/file/migration_spec.rb +0 -0
  100. data/spec/generator_spec/matchers/migration/have_column_spec.rb +0 -0
  101. data/spec/generator_spec/matchers/migration/have_index_spec.rb +0 -0
  102. data/spec/generator_spec/matchers/migration/have_table_spec.rb +0 -0
  103. data/spec/generator_spec/matchers/migration/have_tbl_column_spec.rb +0 -0
  104. data/spec/generator_spec/matchers/migration/have_up_down_spec.rb +0 -0
  105. data/spec/generator_spec/matchers/rails/controller_matcher_spec.rb +0 -27
  106. data/spec/generator_spec/matchers/rails/helper_matcher_spec.rb +0 -26
  107. data/spec/generator_spec/matchers/rails/mailer_matcher_spec.rb +0 -24
  108. data/spec/generator_spec/matchers/rails/model_matcher_spec.rb +0 -31
  109. data/spec/generator_spec/matchers/rails/observer_matcher_spec.rb +0 -19
  110. data/spec/generator_spec/matchers/rails/view_matcher_spec.rb +0 -23
  111. data/spec/generator_spec/rails_helpers/rails_app_spec.rb +0 -0
  112. data/spec/generator_spec/rails_helpers/rails_controller_spec.rb +0 -33
  113. data/spec/generator_spec/rails_helpers/rails_helper_spec.rb +0 -33
  114. data/spec/generator_spec/rails_helpers/rails_mailer_spec.rb +0 -33
  115. data/spec/generator_spec/rails_helpers/rails_migration_spec.rb +0 -0
  116. data/spec/generator_spec/rails_helpers/rails_model_spec.rb +0 -31
  117. data/spec/generator_spec/rails_helpers/rails_observer_spec.rb +0 -33
  118. data/spec/generator_spec/rails_helpers/rails_orm_spec.rb +0 -0
  119. data/spec/generator_spec/rails_helpers/rails_view_spec.rb +0 -31
data/.document CHANGED
File without changes
data/.gitignore CHANGED
File without changes
data/.rspec CHANGED
File without changes
data/LICENSE CHANGED
File without changes
data/README.markdown CHANGED
@@ -1,7 +1,6 @@
1
1
  # RSpec 2 add-on for specifying and testing generators
2
2
 
3
- This project contains RSpec 2 matchers, helpers and various utilities to assist in writing Generator specs.
4
- There is additional support geared towards spec'ing Generators for Rails 3.
3
+ This project contains RSpec 2 matchers, helpers and various utilities to assist in writing Generator specs. There is additional support geared towards writing specs for Generators in Rails 3.
5
4
 
6
5
  ## Why?
7
6
 
@@ -22,12 +21,6 @@ To install the gem from the code, simply use the jeweler rake task:
22
21
 
23
22
  <code>rake install</code>
24
23
 
25
- ## TODO
26
-
27
- Check out ways to improve the DSL, fx using Macros:
28
-
29
- http://gist.github.com/511087
30
-
31
24
  ## Usage
32
25
 
33
26
  The following demonstrates usage of this library. There are many more options and DSL convenience methods (see wiki, code or specs).
@@ -39,7 +32,7 @@ First setup the *spec_helper.rb*. Here is an example configuration.
39
32
  <pre># spec/spec_helper.rb
40
33
 
41
34
  require 'rspec'
42
- require 'generators_spec'
35
+ require 'generator-spec'
43
36
 
44
37
  # configure it like this to use default settings
45
38
  RSpec::Generator.configure do |config|
@@ -88,10 +81,10 @@ require_generators :canable => :all
88
81
 
89
82
  <pre># spec/generators/model_generator_spec.rb
90
83
 
91
- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
84
+ require 'spec_helper'
92
85
 
93
86
  # list of generators to spec are loaded
94
- require 'generators/canable'
87
+ require_generator :canable
95
88
 
96
89
  describe 'model_generator' do
97
90
  # include Rails model helpers for ActiveRecord
@@ -102,8 +95,9 @@ describe 'model_generator' do
102
95
  use_orm :active_record
103
96
 
104
97
  # load helper modules and make available inside spec blocks
105
- # here the module in rails_helpers/rails_migration is included
106
- helpers :migration
98
+ # here the module in rails_helpers/rails_migration is included
99
+ # to load multiple helpers use the method - use_helpers
100
+ use_helper :migration
107
101
 
108
102
  before :each do
109
103
  # define generator to test
@@ -118,6 +112,18 @@ describe 'model_generator' do
118
112
  # ensure clean state after each run
119
113
  remove_model :account
120
114
  end
115
+
116
+ describe "the weird stuff!!!" do
117
+ before :each do
118
+ @generator = with_generator do |g|
119
+ g.run_generator :account.args
120
+ end
121
+ end
122
+
123
+ it "should not work without an existing Account model file" do
124
+ @generator.should_not generate_file :account, :model
125
+ end
126
+ end
121
127
 
122
128
  it "should not work without an existing Account model file" do
123
129
  with_generator do |g|
data/Rakefile CHANGED
@@ -2,47 +2,26 @@ begin
2
2
  require 'jeweler'
3
3
  Jeweler::Tasks.new do |gem|
4
4
  gem.name = "generator-spec"
5
- gem.summary = %Q{RSpec 2 library for writing generator specs}
6
- gem.description = %Q{RSpec 2 library to assist in writing generator specs}
5
+ gem.summary = %Q{RSpec 2 library add-on for testing generators}
6
+ gem.description = %Q{RSpec 2 library to facilitate creating generator specs}
7
7
  gem.email = "kmandrup@gmail.com"
8
8
  gem.homepage = "http://github.com/kristianmandrup/rspec_for_generators"
9
9
  gem.authors = ["Kristian Mandrup"]
10
- gem.add_development_dependency "rspec", ">= 2.0.0.beta19"
11
- gem.add_dependency "rspec", ">= 2.0.0.beta.19"
12
- gem.add_dependency "rake", ">= 0.8.7"
13
- gem.add_dependency "rails", ">= 3.0.0.rc"
14
- gem.add_dependency "test-unit", ">= 2.0.9"
15
- gem.add_dependency "require_all", ">= 1.1.0"
10
+ gem.add_development_dependency "rspec", "~> 2.0.0.beta.22"
11
+ gem.add_development_dependency "mocha", "~> 0.9.8"
12
+ gem.add_development_dependency 'rails-app-spec', "~> 0.2.5"
13
+
14
+ gem.add_dependency "rspec", "~> 2.0.0.beta.22"
15
+ gem.add_dependency "rake", "~> 0.8.7"
16
+ gem.add_dependency "rails", "~> 3.0.0"
17
+ gem.add_dependency "test-unit", "~> 2.0.9"
18
+ gem.add_dependency "require_all", "~> 1.1.0"
19
+ gem.add_dependency "sugar-high", "~> 0.2.5"
20
+ gem.add_dependency "rails3_artifactor", "~> 0.2.0"
21
+
16
22
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
17
23
  end
18
24
  Jeweler::GemcutterTasks.new
19
25
  rescue LoadError
20
26
  puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
21
27
  end
22
-
23
- # require 'spec/rake/spectask'
24
- # Spec::Rake::SpecTask.new(:spec) do |spec|
25
- # spec.libs << 'lib' << 'spec'
26
- # spec.spec_files = FileList['spec/**/*_spec.rb']
27
- # end
28
- #
29
- # Spec::Rake::SpecTask.new(:rcov) do |spec|
30
- # spec.libs << 'lib' << 'spec'
31
- # spec.pattern = 'spec/**/*_spec.rb'
32
- # spec.rcov = true
33
- # end
34
- #
35
- # task :spec => :check_dependencies
36
- #
37
- # task :default => :spec
38
- #
39
- # require 'rake/rdoctask'
40
- # Rake::RDocTask.new do |rdoc|
41
- # version = File.exist?('VERSION') ? File.read('VERSION') : ""
42
- #
43
- # rdoc.rdoc_dir = 'rdoc'
44
- # rdoc.title = "rspec_for_generators #{version}"
45
- # rdoc.rdoc_files.include('README*')
46
- # rdoc.rdoc_files.include('lib/**/*.rb')
47
- # end
48
-
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.6.3
@@ -5,12 +5,12 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{generator-spec}
8
- s.version = "0.5.0"
8
+ s.version = "0.6.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kristian Mandrup"]
12
- s.date = %q{2010-08-14}
13
- s.description = %q{RSpec 2 library to assist in writing generator specs}
12
+ s.date = %q{2010-09-16}
13
+ s.description = %q{RSpec 2 library to facilitate creating generator specs}
14
14
  s.email = %q{kmandrup@gmail.com}
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
@@ -25,51 +25,19 @@ Gem::Specification.new do |s|
25
25
  "Rakefile",
26
26
  "VERSION",
27
27
  "generator-spec.gemspec",
28
- "lib/generator_spec.rb",
29
- "lib/generator_spec/extensions/core_ext.rb",
30
- "lib/generator_spec/helpers/configure_rails.rb",
31
- "lib/generator_spec/helpers/generator_helper.rb",
32
- "lib/generator_spec/helpers/migration_helper.rb",
33
- "lib/generator_spec/main.rb",
34
- "lib/generator_spec/matchers/content/content_matcher.rb",
35
- "lib/generator_spec/matchers/content/have_block.rb",
36
- "lib/generator_spec/matchers/content/have_call.rb",
37
- "lib/generator_spec/matchers/content/have_calls.rb",
38
- "lib/generator_spec/matchers/content/have_class_self.rb",
39
- "lib/generator_spec/matchers/content/have_comment.rb",
40
- "lib/generator_spec/matchers/content/have_method.rb",
41
- "lib/generator_spec/matchers/content/have_module.rb",
42
- "lib/generator_spec/matchers/content/have_region.rb",
43
- "lib/generator_spec/matchers/content/have_subclass.rb",
44
- "lib/generator_spec/matchers/content/include_module.rb",
45
- "lib/generator_spec/matchers/content/inherit_from.rb",
46
- "lib/generator_spec/matchers/file/generate_directory.rb",
47
- "lib/generator_spec/matchers/file/generate_file.rb",
48
- "lib/generator_spec/matchers/file/generate_migration.rb",
49
- "lib/generator_spec/matchers/file/have_file.rb",
50
- "lib/generator_spec/matchers/helpers/content.rb",
51
- "lib/generator_spec/matchers/helpers/file.rb",
52
- "lib/generator_spec/matchers/helpers/migration.rb",
53
- "lib/generator_spec/matchers/migration/have_column.rb",
54
- "lib/generator_spec/matchers/migration/have_index.rb",
55
- "lib/generator_spec/matchers/migration/have_table.rb",
56
- "lib/generator_spec/matchers/migration/have_tbl_column.rb",
57
- "lib/generator_spec/matchers/migration/have_up_down.rb",
58
- "lib/generator_spec/rails_helpers/base_helper.rb",
59
- "lib/generator_spec/rails_helpers/rails_app.rb",
60
- "lib/generator_spec/rails_helpers/rails_controller.rb",
61
- "lib/generator_spec/rails_helpers/rails_helper.rb",
62
- "lib/generator_spec/rails_helpers/rails_mailer.rb",
63
- "lib/generator_spec/rails_helpers/rails_migration.rb",
64
- "lib/generator_spec/rails_helpers/rails_model.rb",
65
- "lib/generator_spec/rails_helpers/rails_observer.rb",
66
- "lib/generator_spec/rails_helpers/rails_orm.rb",
67
- "lib/generator_spec/rails_helpers/rails_view.rb",
68
- "lib/generator_spec/require_generator.rb",
69
- "lib/generator_spec/rspec_generator/configure.rb",
70
- "lib/generator_spec/rspec_generator/generator_util.rb",
71
- "lib/generator_spec/rspec_generator/routes.rb",
72
- "lib/generator_spec/rspec_generator/test_case.rb",
28
+ "lib/generator-spec.rb",
29
+ "lib/generator-spec/namespaces.rb",
30
+ "lib/generator-spec/rails/configure.rb",
31
+ "lib/generator-spec/rspec.rb",
32
+ "lib/generator-spec/rspec/configure.rb",
33
+ "lib/generator-spec/rspec/generator.rb",
34
+ "lib/generator-spec/rspec/generator/configure.rb",
35
+ "lib/generator-spec/rspec/generator/require.rb",
36
+ "lib/generator-spec/rspec/generator/routes.rb",
37
+ "lib/generator-spec/rspec/generator/test_case.rb",
38
+ "lib/generator-spec/rspec/macro.rb",
39
+ "lib/generator-spec/rspec/matchers/generate_artifact.rb",
40
+ "lib/generator-spec/rspec/matchers/generate_artifacts.rb",
73
41
  "lib/generators/controller/controller_generator.rb",
74
42
  "lib/generators/helper/helper_generator.rb",
75
43
  "lib/generators/migration/migration_generator.rb",
@@ -77,47 +45,14 @@ Gem::Specification.new do |s|
77
45
  "lib/generators/model/model_generator.rb",
78
46
  "lib/generators/observer/observer_generator.rb",
79
47
  "lib/generators/view/view_generator.rb",
80
- "rspec_for_generators.gemspec",
81
- "spec/generator_spec/generators/controller_generator_spec.rb",
82
- "spec/generator_spec/generators/helper_generator_spec.rb",
83
- "spec/generator_spec/generators/migration_generator_spec.rb",
84
- "spec/generator_spec/generators/model_generator_spec.rb",
85
- "spec/generator_spec/generators/observer_generator_spec.rb",
86
- "spec/generator_spec/generators/view_generator_spec.rb",
87
- "spec/generator_spec/matchers/content/class_self_spec.rb",
88
- "spec/generator_spec/matchers/content/have_block_spec.rb",
89
- "spec/generator_spec/matchers/content/have_call_spec.rb",
90
- "spec/generator_spec/matchers/content/have_calls_spec.rb",
91
- "spec/generator_spec/matchers/content/have_class_spec.rb",
92
- "spec/generator_spec/matchers/content/have_method_spec.rb",
93
- "spec/generator_spec/matchers/content/have_module_spec.rb",
94
- "spec/generator_spec/matchers/content/have_region_spec.rb",
95
- "spec/generator_spec/matchers/content/have_subclass_spec.rb",
96
- "spec/generator_spec/matchers/content/include_module_spec.rb",
97
- "spec/generator_spec/matchers/content/inherit_from_spec.rb",
98
- "spec/generator_spec/matchers/file/directory_spec.rb",
99
- "spec/generator_spec/matchers/file/file_spec.rb",
100
- "spec/generator_spec/matchers/file/migration_spec.rb",
101
- "spec/generator_spec/matchers/migration/have_column_spec.rb",
102
- "spec/generator_spec/matchers/migration/have_index_spec.rb",
103
- "spec/generator_spec/matchers/migration/have_table_spec.rb",
104
- "spec/generator_spec/matchers/migration/have_tbl_column_spec.rb",
105
- "spec/generator_spec/matchers/migration/have_up_down_spec.rb",
106
- "spec/generator_spec/matchers/rails/controller_matcher_spec.rb",
107
- "spec/generator_spec/matchers/rails/helper_matcher_spec.rb",
108
- "spec/generator_spec/matchers/rails/mailer_matcher_spec.rb",
109
- "spec/generator_spec/matchers/rails/model_matcher_spec.rb",
110
- "spec/generator_spec/matchers/rails/observer_matcher_spec.rb",
111
- "spec/generator_spec/matchers/rails/view_matcher_spec.rb",
112
- "spec/generator_spec/rails_helpers/rails_app_spec.rb",
113
- "spec/generator_spec/rails_helpers/rails_controller_spec.rb",
114
- "spec/generator_spec/rails_helpers/rails_helper_spec.rb",
115
- "spec/generator_spec/rails_helpers/rails_mailer_spec.rb",
116
- "spec/generator_spec/rails_helpers/rails_migration_spec.rb",
117
- "spec/generator_spec/rails_helpers/rails_model_spec.rb",
118
- "spec/generator_spec/rails_helpers/rails_observer_spec.rb",
119
- "spec/generator_spec/rails_helpers/rails_orm_spec.rb",
120
- "spec/generator_spec/rails_helpers/rails_view_spec.rb",
48
+ "spec/generator_spec/generators/controller_gen_spec.rb",
49
+ "spec/generator_spec/generators/helper_gen_spec.rb",
50
+ "spec/generator_spec/generators/migration_gen_spec.rb",
51
+ "spec/generator_spec/generators/model_gen_spec.rb",
52
+ "spec/generator_spec/generators/observer_gen_spec.rb",
53
+ "spec/generator_spec/generators/view_gen_spec.rb",
54
+ "spec/generator_spec/matchers/generate_artifact_spec.rb",
55
+ "spec/generator_spec/matchers/generate_artifacts_spec.rb",
121
56
  "spec/spec_helper.rb",
122
57
  "wiki/Custom Rails 3 Generators.textile",
123
58
  "wiki/content_matchers.textile",
@@ -129,48 +64,16 @@ Gem::Specification.new do |s|
129
64
  s.rdoc_options = ["--charset=UTF-8"]
130
65
  s.require_paths = ["lib"]
131
66
  s.rubygems_version = %q{1.3.7}
132
- s.summary = %q{RSpec 2 library for writing generator specs}
67
+ s.summary = %q{RSpec 2 library add-on for testing generators}
133
68
  s.test_files = [
134
- "spec/generator_spec/generators/controller_generator_spec.rb",
135
- "spec/generator_spec/generators/helper_generator_spec.rb",
136
- "spec/generator_spec/generators/migration_generator_spec.rb",
137
- "spec/generator_spec/generators/model_generator_spec.rb",
138
- "spec/generator_spec/generators/observer_generator_spec.rb",
139
- "spec/generator_spec/generators/view_generator_spec.rb",
140
- "spec/generator_spec/matchers/content/class_self_spec.rb",
141
- "spec/generator_spec/matchers/content/have_block_spec.rb",
142
- "spec/generator_spec/matchers/content/have_call_spec.rb",
143
- "spec/generator_spec/matchers/content/have_calls_spec.rb",
144
- "spec/generator_spec/matchers/content/have_class_spec.rb",
145
- "spec/generator_spec/matchers/content/have_method_spec.rb",
146
- "spec/generator_spec/matchers/content/have_module_spec.rb",
147
- "spec/generator_spec/matchers/content/have_region_spec.rb",
148
- "spec/generator_spec/matchers/content/have_subclass_spec.rb",
149
- "spec/generator_spec/matchers/content/include_module_spec.rb",
150
- "spec/generator_spec/matchers/content/inherit_from_spec.rb",
151
- "spec/generator_spec/matchers/file/directory_spec.rb",
152
- "spec/generator_spec/matchers/file/file_spec.rb",
153
- "spec/generator_spec/matchers/file/migration_spec.rb",
154
- "spec/generator_spec/matchers/migration/have_column_spec.rb",
155
- "spec/generator_spec/matchers/migration/have_index_spec.rb",
156
- "spec/generator_spec/matchers/migration/have_table_spec.rb",
157
- "spec/generator_spec/matchers/migration/have_tbl_column_spec.rb",
158
- "spec/generator_spec/matchers/migration/have_up_down_spec.rb",
159
- "spec/generator_spec/matchers/rails/controller_matcher_spec.rb",
160
- "spec/generator_spec/matchers/rails/helper_matcher_spec.rb",
161
- "spec/generator_spec/matchers/rails/mailer_matcher_spec.rb",
162
- "spec/generator_spec/matchers/rails/model_matcher_spec.rb",
163
- "spec/generator_spec/matchers/rails/observer_matcher_spec.rb",
164
- "spec/generator_spec/matchers/rails/view_matcher_spec.rb",
165
- "spec/generator_spec/rails_helpers/rails_app_spec.rb",
166
- "spec/generator_spec/rails_helpers/rails_controller_spec.rb",
167
- "spec/generator_spec/rails_helpers/rails_helper_spec.rb",
168
- "spec/generator_spec/rails_helpers/rails_mailer_spec.rb",
169
- "spec/generator_spec/rails_helpers/rails_migration_spec.rb",
170
- "spec/generator_spec/rails_helpers/rails_model_spec.rb",
171
- "spec/generator_spec/rails_helpers/rails_observer_spec.rb",
172
- "spec/generator_spec/rails_helpers/rails_orm_spec.rb",
173
- "spec/generator_spec/rails_helpers/rails_view_spec.rb",
69
+ "spec/generator_spec/generators/controller_gen_spec.rb",
70
+ "spec/generator_spec/generators/helper_gen_spec.rb",
71
+ "spec/generator_spec/generators/migration_gen_spec.rb",
72
+ "spec/generator_spec/generators/model_gen_spec.rb",
73
+ "spec/generator_spec/generators/observer_gen_spec.rb",
74
+ "spec/generator_spec/generators/view_gen_spec.rb",
75
+ "spec/generator_spec/matchers/generate_artifact_spec.rb",
76
+ "spec/generator_spec/matchers/generate_artifacts_spec.rb",
174
77
  "spec/spec_helper.rb"
175
78
  ]
176
79
 
@@ -179,27 +82,39 @@ Gem::Specification.new do |s|
179
82
  s.specification_version = 3
180
83
 
181
84
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
182
- s.add_development_dependency(%q<rspec>, [">= 2.0.0.beta19"])
183
- s.add_runtime_dependency(%q<rspec>, [">= 2.0.0.beta.19"])
184
- s.add_runtime_dependency(%q<rake>, [">= 0.8.7"])
185
- s.add_runtime_dependency(%q<rails>, [">= 3.0.0.rc"])
186
- s.add_runtime_dependency(%q<test-unit>, [">= 2.0.9"])
187
- s.add_runtime_dependency(%q<require_all>, [">= 1.1.0"])
85
+ s.add_development_dependency(%q<rspec>, ["~> 2.0.0.beta.22"])
86
+ s.add_development_dependency(%q<mocha>, ["~> 0.9.8"])
87
+ s.add_development_dependency(%q<rails-app-spec>, ["~> 0.2.5"])
88
+ s.add_runtime_dependency(%q<rspec>, ["~> 2.0.0.beta.22"])
89
+ s.add_runtime_dependency(%q<rake>, ["~> 0.8.7"])
90
+ s.add_runtime_dependency(%q<rails>, ["~> 3.0.0"])
91
+ s.add_runtime_dependency(%q<test-unit>, ["~> 2.0.9"])
92
+ s.add_runtime_dependency(%q<require_all>, ["~> 1.1.0"])
93
+ s.add_runtime_dependency(%q<sugar-high>, ["~> 0.2.5"])
94
+ s.add_runtime_dependency(%q<rails3_artifactor>, ["~> 0.2.0"])
188
95
  else
189
- s.add_dependency(%q<rspec>, [">= 2.0.0.beta19"])
190
- s.add_dependency(%q<rspec>, [">= 2.0.0.beta.19"])
191
- s.add_dependency(%q<rake>, [">= 0.8.7"])
192
- s.add_dependency(%q<rails>, [">= 3.0.0.rc"])
193
- s.add_dependency(%q<test-unit>, [">= 2.0.9"])
194
- s.add_dependency(%q<require_all>, [">= 1.1.0"])
96
+ s.add_dependency(%q<rspec>, ["~> 2.0.0.beta.22"])
97
+ s.add_dependency(%q<mocha>, ["~> 0.9.8"])
98
+ s.add_dependency(%q<rails-app-spec>, ["~> 0.2.5"])
99
+ s.add_dependency(%q<rspec>, ["~> 2.0.0.beta.22"])
100
+ s.add_dependency(%q<rake>, ["~> 0.8.7"])
101
+ s.add_dependency(%q<rails>, ["~> 3.0.0"])
102
+ s.add_dependency(%q<test-unit>, ["~> 2.0.9"])
103
+ s.add_dependency(%q<require_all>, ["~> 1.1.0"])
104
+ s.add_dependency(%q<sugar-high>, ["~> 0.2.5"])
105
+ s.add_dependency(%q<rails3_artifactor>, ["~> 0.2.0"])
195
106
  end
196
107
  else
197
- s.add_dependency(%q<rspec>, [">= 2.0.0.beta19"])
198
- s.add_dependency(%q<rspec>, [">= 2.0.0.beta.19"])
199
- s.add_dependency(%q<rake>, [">= 0.8.7"])
200
- s.add_dependency(%q<rails>, [">= 3.0.0.rc"])
201
- s.add_dependency(%q<test-unit>, [">= 2.0.9"])
202
- s.add_dependency(%q<require_all>, [">= 1.1.0"])
108
+ s.add_dependency(%q<rspec>, ["~> 2.0.0.beta.22"])
109
+ s.add_dependency(%q<mocha>, ["~> 0.9.8"])
110
+ s.add_dependency(%q<rails-app-spec>, ["~> 0.2.5"])
111
+ s.add_dependency(%q<rspec>, ["~> 2.0.0.beta.22"])
112
+ s.add_dependency(%q<rake>, ["~> 0.8.7"])
113
+ s.add_dependency(%q<rails>, ["~> 3.0.0"])
114
+ s.add_dependency(%q<test-unit>, ["~> 2.0.9"])
115
+ s.add_dependency(%q<require_all>, ["~> 1.1.0"])
116
+ s.add_dependency(%q<sugar-high>, ["~> 0.2.5"])
117
+ s.add_dependency(%q<rails3_artifactor>, ["~> 0.2.0"])
203
118
  end
204
119
  end
205
120
 
@@ -0,0 +1,12 @@
1
+ require 'rspec'
2
+ require 'rake'
3
+ require 'rails'
4
+ require 'require_all'
5
+ require 'sugar-high/arguments'
6
+ require 'sugar-high/module'
7
+ require 'rails-app-spec'
8
+
9
+ require 'generator-spec/namespaces'
10
+ require 'generator-spec/rails/configure'
11
+ require 'generator-spec/rspec'
12
+
@@ -0,0 +1,7 @@
1
+ module RSpec
2
+ modules :generator, :rails
3
+ end
4
+
5
+ module Rails
6
+ modules :generators
7
+ end
@@ -20,7 +20,7 @@ end
20
20
 
21
21
  module Rails
22
22
  def self.root
23
- @root ||= File.join(Rails.application.config.root_dir, 'rails')
23
+ @root ||= File.join(Rails.application.config.root_dir, 'rails_app')
24
24
  end
25
25
  end
26
26
 
@@ -29,7 +29,6 @@ end
29
29
 
30
30
  Rails.application = TestApp
31
31
 
32
- # !!!!!!!!!!!!!!!!!!!!!!
33
32
  module Rails
34
33
  def self.logger
35
34
  logger_type = RSpec::Generator.logger
@@ -44,7 +43,8 @@ module Rails
44
43
  return Logger.new(STDOUT)
45
44
  end
46
45
  if file != @logger_file
47
- @logger_file = file
46
+ @logger_file = file
47
+ RSpec::Generator.logfile = file
48
48
  @logger = Logger.new(file) if file
49
49
  else
50
50
  @logger ||= Logger.new(file) if file