spec/sinatra/app/racks_spec.rb in skellington-0.8.9 vs spec/sinatra/app/racks_spec.rb in skellington-0.9.0.pre.rc1

- old
+ new

@@ -1,46 +1,48 @@ module Skellington describe CLI do - let :subject do - described_class.new - end + context 'sinatra' 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' + 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' + 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'] } + if CONFIG['google-analytics-tag'] + use Rack::Tracker do + handler :google_analytics, { tracker: CONFIG['google-analytics-tag'] } + end 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 + 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 + before do + if negotiated? + content_type negotiated_type + end end end end + """ + ) end - """ - ) end end end