merb-gen 0.9.13 → 1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1,2 @@
1
- Autotest.add_discovery { "merb" }
1
+ Autotest.add_discovery { "merb" }
2
+ Autotest.add_discovery { "rspec" }
@@ -15,7 +15,10 @@ class Autotest::Merb < Autotest
15
15
  initialize_test_layout
16
16
 
17
17
  # Ignore any happenings in these directories
18
- add_exception %r%^\./(?:doc|log|public|tmp)%
18
+ add_exception %r%^\./(?:doc|log|public|tmp|\.git|\.hg|\.svn|framework|gems|schema|\.DS_Store|autotest|bin|.*\.sqlite3)%
19
+ # Ignore SCM directories and custom Autotest mappings
20
+ %w[.svn .hg .git .autotest].each { |exception| add_exception(exception) }
21
+
19
22
 
20
23
  # Ignore any mappings that Autotest may have already set up
21
24
  clear_mappings
@@ -36,7 +39,7 @@ class Autotest::Merb < Autotest
36
39
  ]
37
40
  end
38
41
 
39
- # Any change to a test or test will cause it to be run
42
+ # Any change to a test will cause it to be run
40
43
  add_mapping %r%^test/(unit|models|integration|controllers|views|functional)/.*rb$% do |filename, _|
41
44
  filename
42
45
  end
@@ -14,7 +14,7 @@ class Autotest::MerbRspec < Autotest
14
14
  super
15
15
 
16
16
  # Ignore any happenings in these directories
17
- add_exception %r%^\./(?:doc|log|public|tmp|\.git|\.hg|\.svn|framework|gems|schema|\.DS_Store|autotest|bin|.*\.sqlite3)%
17
+ add_exception %r%^\./(?:doc|log|public|tmp|\.git|\.hg|\.svn|framework|gems|schema|\.DS_Store|autotest|bin|.*\.sqlite3|.*\.thor)%
18
18
  # Ignore SCM directories and custom Autotest mappings
19
19
  %w[.svn .hg .git .autotest].each { |exception| add_exception(exception) }
20
20
 
@@ -44,7 +44,7 @@ class Autotest::MerbRspec < Autotest
44
44
  # Any change to global_helpers will result in all view and controller
45
45
  # tests being run
46
46
  add_mapping %r%^app/helpers/global_helpers\.rb% do
47
- files_matching %r%^spec/(views|controllers|helpers)/.*_spec\.rb$%
47
+ files_matching %r%^spec/(views|controllers|helpers|requests)/.*_spec\.rb$%
48
48
  end
49
49
 
50
50
  # Any change to a helper will cause its spec to be run
@@ -0,0 +1,7 @@
1
+ require File.join(File.dirname(__FILE__), <%= go_up(modules.size + 1) %>, 'spec_helper.rb')
2
+
3
+ describe "/<%= full_class_name.to_s.to_const_path %>" do
4
+ before(:each) do
5
+ @response = request("/<%= full_class_name.to_s.to_const_path %>")
6
+ end
7
+ end
@@ -6,8 +6,7 @@ class <%= full_class_name %>; def rescue_action(e) raise e end; end
6
6
  class <%= full_class_name %>Test < Test::Unit::TestCase
7
7
 
8
8
  def setup
9
- @controller = <%= full_class_name %>.build(fake_request)
10
- @controller.dispatch('index')
9
+ @resonse = request("/<%= full_class_name.to_s.to_const_path %>")
11
10
  end
12
11
 
13
12
  # Replace this with your real tests.
@@ -1,4 +1,4 @@
1
1
  <h1><%= class_name %> controller, edit action</h1>
2
2
 
3
3
  <p>Edit this file in <tt>app/views/<%= file_name %>/edit.html.erb</tt></p>
4
- <p>For more information and examples of CRUD views read <a href="http://wiki.merbivore.com/howto/crud_view_example_with_merb_using_erb"> this wiki page</a>
4
+ <p>For more information and examples of CRUD views read <a href="http://wiki.merbivore.com/howto/crud_view_example_with_merb_using_erb"> this wiki page</a></p>
@@ -1,4 +1,4 @@
1
1
  <h1><%= class_name %> controller, index action</h1>
2
2
 
3
3
  <p>Edit this file in <tt>app/views/<%= file_name %>/index.html.erb</tt></p>
4
- <p>For more information and examples of CRUD views read <a href="http://wiki.merbivore.com/howto/crud_view_example_with_merb_using_erb"> this wiki page</a>
4
+ <p>For more information and examples of CRUD views read <a href="http://wiki.merbivore.com/howto/crud_view_example_with_merb_using_erb"> this wiki page</a></p>
@@ -1,4 +1,4 @@
1
1
  <h1><%= class_name %> controller, new action</h1>
2
2
 
3
3
  <p>Edit this file in <tt>app/views/<%= file_name %>/new.html.erb</tt></p>
4
- <p>For more information and examples of CRUD views read <a href="http://wiki.merbivore.com/howto/crud_view_example_with_merb_using_erb"> this wiki page</a>
4
+ <p>For more information and examples of CRUD views read <a href="http://wiki.merbivore.com/howto/crud_view_example_with_merb_using_erb"> this wiki page</a></p>
@@ -1,4 +1,4 @@
1
1
  <h1><%= class_name %> controller, show action</h1>
2
2
 
3
3
  <p>Edit this file in <tt>app/views/<%= file_name %>/show.html.erb</tt></p>
4
- <p>For more information and examples of CRUD views read <a href="http://wiki.merbivore.com/howto/crud_view_example_with_merb_using_erb"> this wiki page</a>
4
+ <p>For more information and examples of CRUD views read <a href="http://wiki.merbivore.com/howto/crud_view_example_with_merb_using_erb"> this wiki page</a></p>
@@ -110,7 +110,7 @@ describe "resource(@<%= singular_model %>)", :given => "a <%= singular_model %>
110
110
  before(:each) do
111
111
  @<%= singular_model %> = <%= model_class_name %>.first
112
112
  @response = request(resource(@<%= singular_model %>), :method => "PUT",
113
- :params => { :article => {:id => @<%= singular_model %>.id} })
113
+ :params => { :<%= singular_model %> => {:id => @<%= singular_model %>.id} })
114
114
  end
115
115
 
116
116
  it "redirect to the article show action" do
@@ -19,7 +19,7 @@ describe Merb::Generators::ControllerGenerator do
19
19
  describe "with rspec" do
20
20
 
21
21
  it "should create a controller spec" do
22
- @generator.should create('/tmp/spec/controllers/stuff_spec.rb')
22
+ @generator.should create('/tmp/spec/requests/stuff_spec.rb')
23
23
  end
24
24
 
25
25
  it "should render templates successfully" do
@@ -35,7 +35,7 @@ describe Merb::Generators::ControllerGenerator do
35
35
  end
36
36
 
37
37
  it "should create a controller test" do
38
- @generator.should create('/tmp/test/controllers/stuff_test.rb')
38
+ @generator.should create('/tmp/test/requests/stuff_test.rb')
39
39
  end
40
40
 
41
41
  it "should render templates successfully" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: merb-gen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.13
4
+ version: "1.0"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Nicklas
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-11-03 00:00:00 -08:00
12
+ date: 2008-11-08 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 0.9.13
23
+ version: "1.0"
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: templater
@@ -231,11 +231,11 @@ files:
231
231
  - lib/generators/templates/component/controller/app/views/%file_name%
232
232
  - lib/generators/templates/component/controller/app/views/%file_name%/index.html.erb
233
233
  - lib/generators/templates/component/controller/spec
234
- - lib/generators/templates/component/controller/spec/controllers
235
- - lib/generators/templates/component/controller/spec/controllers/%file_name%_spec.rb
234
+ - lib/generators/templates/component/controller/spec/requests
235
+ - lib/generators/templates/component/controller/spec/requests/%file_name%_spec.rb
236
236
  - lib/generators/templates/component/controller/test
237
- - lib/generators/templates/component/controller/test/controllers
238
- - lib/generators/templates/component/controller/test/controllers/%file_name%_test.rb
237
+ - lib/generators/templates/component/controller/test/requests
238
+ - lib/generators/templates/component/controller/test/requests/%file_name%_test.rb
239
239
  - lib/generators/templates/component/helper
240
240
  - lib/generators/templates/component/helper/app
241
241
  - lib/generators/templates/component/helper/app/helpers
@@ -1,7 +0,0 @@
1
- require File.join(File.dirname(__FILE__), <%= go_up(modules.size + 1) %>, 'spec_helper.rb')
2
-
3
- describe <%= full_class_name %>, "index action" do
4
- before(:each) do
5
- dispatch_to(<%= full_class_name %>, :index)
6
- end
7
- end