Sha256: 4af1b5e25f2beb7dffffc759ecae34c16667d4203b39a2b32c3a86d2ce493255

Contents?: true

Size: 1.04 KB

Versions: 8

Compression:

Stored size: 1.04 KB

Contents

module Skellington
  describe CLI do
    let :subject do
      described_class.new
    end

    it 'generates an app file' do
      subject.generate 'dummy_app'
      expect('dummy_app/lib/dummy_app/racks.rb').to have_content (
      """
      require 'rack/conneg'
      require 'rack/tracker'

      module DummyApp
        class App < Sinatra::Base
          set :public_folder, 'public'
          set :views, 'views'

          if CONFIG['google-analytics-tag']
            use Rack::Tracker do
              handler :google_analytics, { tracker: CONFIG['google-analytics-tag'] }
            end
          end

          use Rack::Conneg do |conneg|
            conneg.set :accept_all_extensions, true
            conneg.set :fallback, :html
            conneg.ignore_contents_of 'public'
            conneg.provide [
              :html,
              :json
            ]
          end

          before do
            if negotiated?
              content_type negotiated_type
            end
          end
        end
      end
      """
      )
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
skellington-0.8.3 spec/sinatra/app/racks_spec.rb
skellington-0.8.2 spec/sinatra/app/racks_spec.rb
skellington-0.8.1 spec/sinatra/cli/racks_spec.rb
skellington-0.8.0 spec/sinatra/cli/racks_spec.rb
skellington-0.7.5 spec/cli/racks_spec.rb
skellington-0.7.4 spec/cli/racks_spec.rb
skellington-0.7.3 spec/cli/racks_spec.rb
skellington-0.7.2 spec/cli/racks_spec.rb