no, wait, *now* i've got it right

This commit is contained in:
John Bintz 2011-04-15 16:00:25 -04:00
parent 3c8342fca4
commit f8fa5573c8
3 changed files with 6 additions and 6 deletions

View File

@ -6,8 +6,8 @@ Currently only works with Rails-ish projects and with Jasmine & Jammit. I'm self
`backbone-generate model Admin::User` creates an AdminUserModel object in:
* `public/javascripts/models/admin/user_model.js`
* `spec/javascripts/models/admin/user_model_spec.js`
* `public/javascripts/models/admin/user.js`
* `spec/javascripts/models/admin/user_spec.js`
### View

View File

@ -24,8 +24,8 @@ class BackboneGenerator < Thor
desc 'model Namespaced::Name', "Create a model"
def model(name)
@name = name
template('model.js.erb', "public/javascripts/models/#{underscore_name}_model.js")
template('model_spec.js.erb', "spec/javascripts/models/#{underscore_name}_model_spec.js")
template('model.js.erb', "public/javascripts/models/#{underscore_name}.js")
template('model_spec.js.erb', "spec/javascripts/models/#{underscore_name}_spec.js")
end
desc 'view Namespaced::Name', "Create a view"

View File

@ -15,8 +15,8 @@ describe 'backbone-generator' do
it "should generate the model files" do
system %{bin/backbone-generator model Section::Model}
File.file?(model = 'public/javascripts/models/section/model_model.js').should be_true
File.file?(spec = 'spec/javascripts/models/section/model_model_spec.js').should be_true
File.file?(model = 'public/javascripts/models/section/model.js').should be_true
File.file?(spec = 'spec/javascripts/models/section/model_spec.js').should be_true
File.read(model).should match(/SectionModel/)
File.read(spec).should match(/SectionModel/)