rack-livereload/spec/rack/livereload_spec.rb

30 lines
594 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 }
2015-07-03 16:20:54 +00:00
it 'should be an app' do
middleware.app.should be == app
end
2011-11-04 15:51:22 +00:00
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
2015-07-03 16:20:54 +00:00
middleware._call(env).should be_truthy
2011-11-04 15:51:22 +00:00
end
end
end