diff --git a/spec/rack/livereload_spec.rb b/spec/rack/livereload_spec.rb index 4652732..649a9e6 100644 --- a/spec/rack/livereload_spec.rb +++ b/spec/rack/livereload_spec.rb @@ -223,5 +223,22 @@ describe Rack::LiveReload do it { should be_bad_browser(user_agent) } end + + describe 'head tag regex' do + let(:regex) { described_class::HEAD_TAG_REGEX } + subject { regex } + + it { should be_kind_of(Regexp) } + + it 'only picks a valid tag' do + regex.match("").to_s.should eq('') + regex.match("").to_s.should eq('') + regex.match("").to_s.should eq("") + end + + it 'responds false when no head tag' do + regex.match("
").should be_false + end + end end