Sha256: 323b354289afbf1fcb6a99754c766e54658ba0ee85d7084170e26efac9f71502

Contents?: true

Size: 1.62 KB

Versions: 6

Compression:

Stored size: 1.62 KB

Contents

require 'spec_helper'

slices_path = File.dirname(__FILE__) / 'slices'

describe Merb::Generators::ThinSliceGenerator do
  
  describe "templates" do
    
    before(:all) { FileUtils.rm_rf(slices_path / 'testing-thin') rescue nil }
    after(:all)  { FileUtils.rm_rf(slices_path / 'testing-thin') rescue nil }
    
    before do
      @generator = Merb::Generators::ThinSliceGenerator.new(slices_path, {}, 'testing-thin')
    end
    
    it "should create a number of templates" do
      @generator.invoke!
      files = Dir[slices_path / 'testing-thin' / '**' / '*'].map do |path| 
        path.relative_path_from(slices_path)
      end.sort
      expected = [
        "testing-thin/application.rb", "testing-thin/lib", "testing-thin/lib/testing-thin", 
        "testing-thin/lib/testing-thin/merbtasks.rb", "testing-thin/lib/testing-thin/slicetasks.rb", 
        "testing-thin/lib/testing-thin.rb", "testing-thin/LICENSE", "testing-thin/public", 
        "testing-thin/public/javascripts", "testing-thin/public/javascripts/master.js", 
        "testing-thin/public/stylesheets", "testing-thin/public/stylesheets/master.css", 
        "testing-thin/Rakefile", "testing-thin/README", "testing-thin/stubs", 
        "testing-thin/stubs/application.rb", "testing-thin/TODO", "testing-thin/views", 
        "testing-thin/views/layout", "testing-thin/views/layout/testing_thin.html.erb", 
        "testing-thin/views/main", "testing-thin/views/main/index.html.erb"
      ].sort
      files.should == expected
    end
    
    it "should render templates successfully" do
      lambda { @generator.render! }.should_not raise_error
    end
    
  end
  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
merb-slices-1.1.3 spec/thin_slice_generator_spec.rb
merb-slices-1.1.2 spec/thin_slice_generator_spec.rb
merb-slices-1.1.1 spec/thin_slice_generator_spec.rb
merb-slices-1.1.0 spec/thin_slice_generator_spec.rb
merb-slices-1.1.0.rc1 spec/thin_slice_generator_spec.rb
merb-slices-1.1.0.pre spec/thin_slice_generator_spec.rb