rack-livereload/spec/rack/livereload_spec.rb

28 lines
555 B
Ruby
Raw Normal View History

2011-11-04 15:51:22 +00:00
require 'spec_helper'
require 'nokogiri'
2011-11-04 15:51:22 +00:00
describe Rack::LiveReload do
let(:middleware) { described_class.new(app, options) }
2011-11-04 15:51:22 +00:00
let(:app) { stub }
subject { middleware }
its(:app) { should == app }
let(:env) { {} }
let(:options) { {} }
2011-11-04 15:51:22 +00:00
context '/__rack/livereload.js' do
2013-04-23 20:28:23 +00:00
let(:env) { { 'PATH_INFO' => described_class::BodyProcessor::LIVERELOAD_JS_PATH } }
2011-11-04 15:51:22 +00:00
before do
middleware.expects(:deliver_file).returns(true)
end
it 'should return the js file' do
middleware._call(env).should be_truthy
2011-11-04 15:51:22 +00:00
end
end
end