2011-11-04 15:51:22 +00:00
|
|
|
require 'spec_helper'
|
2012-12-03 19:00:45 +00:00
|
|
|
require 'nokogiri'
|
2011-11-04 15:51:22 +00:00
|
|
|
|
|
|
|
describe Rack::LiveReload do
|
2011-11-08 14:48:34 +00:00
|
|
|
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) { {} }
|
2011-11-08 14:48:34 +00:00
|
|
|
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
|
2014-12-05 16:23:31 +00:00
|
|
|
middleware._call(env).should be_truthy
|
2011-11-04 15:51:22 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2011-11-07 14:06:40 +00:00
|
|
|
|