Sha256: 704c3808b58e42cd9cef9482703d8be64044a57dacd524b3f3aebee6950a88ad

Contents?: true

Size: 1.4 KB

Versions: 3

Compression:

Stored size: 1.4 KB

Contents

require 'rspec/core'
require 'generator-spec'
# require 'spec_helper'

RSpec::Generator::Require.root_dir = 'generator_spec/fixtures'

require_generator :model

describe 'model_generator' do
  use_orm :mongoid

  # before do
  #   setup_generator :model do
  #     tests ModelGenerator
  #   end    
  # end
  # 
  # before :each do              
  #   remove_model :account    
  # end
  # 
  # after :each do              
  #   remove_model :account    
  # end
  #   
  it "should not work without an Account model file" do            
    1.should == 1
    # with_generator do |g|   
    #   g.run_generator :account.args
    #   g.should_not generate_model_file :account
    # end
  end
  # 
  # it "should decorate an existing Account model file with include Canable:Ables" do            
  #   create_model :account do
  #     'hello'
  #   end
  #   with_generator do |g|             
  #     # g.run_generator :account.args
  #     
  #     g.should_not generate_model_file :user
  #     g.should_not generate_controller_file :user      
  #     
  #     g.should generate_model_file :account do |content|
  #       content.should include_module 'Canable::Ables'
  #     end
  #   end
  # end
  # 
  # it "should not have generated other things!" do            
  #   with_generator do |g|        
  #     g.should_not generate_model_file :user
  #     g.should_not generate_controller_file :user      
  #   end
  # end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
generator-spec-0.7.8 spec/generator_spec/matchers/generate_artifact_file_spec.rb
generator-spec-0.7.6 spec/generator_spec/matchers/generate_artifact_file_spec.rb
generator-spec-0.7.5 spec/generator_spec/matchers/generate_artifact_file_spec.rb