jasmine-headless-webkit/spec/lib/jasmine/headless_spec.rb
2012-01-11 08:44:28 -05:00

39 lines
733 B
Ruby

require 'spec_helper'
describe Jasmine::Headless do
describe '.warn' do
let(:output) { StringIO.new }
before do
described_class.stubs(:output).returns(output)
end
context 'warnings enabled' do
before do
described_class.stubs(:show_warnings?).returns(true)
end
it 'should work' do
described_class.warn("warning")
output.rewind
output.read.should == "warning\n"
end
end
context 'warnings disabled' do
before do
described_class.stubs(:show_warnings?).returns(false)
end
it 'should work' do
described_class.warn("warning")
output.rewind
output.read.should == ""
end
end
end
end