Permalink
Browse files

specs -> spec

  • Loading branch information...
1 parent a47e8c4 commit 3d4ad1f0e6c64fc6a20bf1d1d516897bef50767d @sorah sorah committed Jun 21, 2012
Showing with 14 additions and 14 deletions.
  1. +5 −5 README.rdoc
  2. +4 −4 lib/generators/chanko/USAGE
  3. +5 −5 lib/generators/chanko/chanko_generator.rb
View
@@ -35,9 +35,9 @@ Generate chanko.
create app/units/sample/views/_show.html.haml
create app/units/sample/stylesheets/tutorial.scss
create app/units/sample/images/logo.png
- create app/units/sample/specs/models/sample_spec.rb
- create app/units/sample/specs/controllers/sample_controller_spec.rb
- create app/units/sample/specs/helpers/sample_helper_spec.rb
+ create app/units/sample/spec/models/sample_spec.rb
+ create app/units/sample/spec/controllers/sample_controller_spec.rb
+ create app/units/sample/spec/helpers/sample_helper_spec.rb
=== app/units/sample/sample.rb
Main file. You write your model and controller logic in this file.
@@ -56,8 +56,8 @@ app/units/sample/images to (public or assets)/images/units/#{unit_name}
with attention to use the relative path.
If you used generator, the symbolic link is automaticlly generated.
-=== app/units/sample/specs/
-Tests for this chanko go here.
+=== app/units/sample/spec/
+Spec files for this chanko go here.
== Syntax
module Sample
@@ -5,7 +5,7 @@ Description:
This will generate the unit class template in app/units/,
a view stub in /app/units/#{unit_name}/views/ ,
a stylesheet in /app/units/#{unit_name}/stylesheets/ ,
- spec stubs in /app/units/#{unit_name}/specs/ ,
+ spec stubs in /app/units/#{unit_name}/spec/ ,
and the blank logo.png in /app/units/#{unit_name}/images/
along with a symlink in public/images/units/#{unit_name}
@@ -19,7 +19,7 @@ Example:
app/units/sample/views/show.html.haml
app/units/sample/stylesheets/sample.scss
app/units/sample/images/logo.png
- app/units/sample/specs/controllers/sample_controller_spec.rb
- app/units/sample/specs/models/sample_model_spec.rb
- app/units/sample/specs/helper/sample_helper_spec.rb
+ app/units/sample/spec/controllers/sample_controller_spec.rb
+ app/units/sample/spec/models/sample_model_spec.rb
+ app/units/sample/spec/helper/sample_helper_spec.rb
public/images/units/sample -> ../../../app/units/sample/images
@@ -6,7 +6,7 @@ class ChankoGenerator < Rails::Generators::NamedBase
class_option :js, :type => :boolean, :default => true, :description => "Generate a template javascript file"
class_option :coffee, :type => :boolean, :default => false, :description => "Generate a template coffeescript file"
class_option :image, :type => :boolean, :default => true, :description => "Generate a blank image"
- class_option :specs, :type => :boolean, :default => true, :description => "Generate template specs files"
+ class_option :spec, :type => :boolean, :default => true, :description => "Generate template spec files"
class_option :view, :type => :boolean, :default => true, :description => "Generate a template view file"
class_option :bare, :type => :boolean, :default => false, :description => "Generate a blank extension which only includes the ruby file"
@@ -21,10 +21,10 @@ def create_view_files
end
def create_spec_file
- if !options.bare? && options.specs?
- template 'chanko_controller_spec.rb', File.join("app", base_directory, file_name, "specs/controllers", "#{file_name}_controller_spec.rb")
- template 'chanko_model_spec.rb', File.join("app", base_directory, file_name, "specs/models", "#{file_name}_model_spec.rb")
- template 'chanko_helper_spec.rb', File.join("app", base_directory, file_name, "specs/helpers", "#{file_name}_helper_spec.rb")
+ if !options.bare? && options.spec?
+ template 'chanko_controller_spec.rb', File.join("app", base_directory, file_name, "spec/controllers", "#{file_name}_controller_spec.rb")
+ template 'chanko_model_spec.rb', File.join("app", base_directory, file_name, "spec/models", "#{file_name}_model_spec.rb")
+ template 'chanko_helper_spec.rb', File.join("app", base_directory, file_name, "spec/helpers", "#{file_name}_helper_spec.rb")
end
end

0 comments on commit 3d4ad1f

Please sign in to comment.