* suppressing puts to stdout in test runs
This commit is contained in:
parent
01e50b45b3
commit
ece0b9bf87
|
|
@ -44,7 +44,7 @@ module JAmXml
|
|||
end
|
||||
end
|
||||
unless ident <= 0
|
||||
puts "#{tbse}</#{nm}>"
|
||||
output.puts "#{tbse}</#{nm}>"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,31 @@
|
|||
require 'spec_helper'
|
||||
require 'stringio'
|
||||
|
||||
=begin
|
||||
example output:
|
||||
|
||||
<directory>
|
||||
<yp-url-timeout>15</yp-url-timeout>
|
||||
<yp-url>http://dir.xiph.org/cgi-bin/yp-cgi</yp-url>
|
||||
</directory>
|
||||
=end
|
||||
describe IcecastDirectory do
|
||||
|
||||
let(:idir) { IcecastDirectory.new }
|
||||
let(:output) { StringIO.new }
|
||||
|
||||
before(:all) do
|
||||
before(:each) do
|
||||
|
||||
end
|
||||
|
||||
|
||||
it "save" do
|
||||
idir.save.should be_true
|
||||
idir.dumpXml
|
||||
idir.dumpXml(1, output)
|
||||
|
||||
output.rewind
|
||||
directory = Nokogiri::XML(output)
|
||||
directory.css('directory yp-url-timeout').text.should == "15"
|
||||
directory.css('directory yp-url').text.should == "http://dir.xiph.org/cgi-bin/yp-cgi"
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ require 'spec_helper'
|
|||
describe IcecastListenSocket do
|
||||
|
||||
let(:iobj) { IcecastListenSocket.new }
|
||||
let(:output) { StringIO.new }
|
||||
|
||||
before(:all) do
|
||||
|
||||
|
|
@ -10,7 +11,12 @@ describe IcecastListenSocket do
|
|||
|
||||
it "save" do
|
||||
iobj.save.should be_true
|
||||
iobj.dumpXml
|
||||
iobj.dumpXml(1, output)
|
||||
|
||||
output.rewind
|
||||
directory = Nokogiri::XML(output)
|
||||
directory.css('listen-socket port').text.should == "8001"
|
||||
directory.css('listen-socket shoutcast-compat').text.should == "0"
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,14 +3,19 @@ require 'spec_helper'
|
|||
describe IcecastLogging do
|
||||
|
||||
let(:iobj) { IcecastLogging.new }
|
||||
|
||||
before(:all) do
|
||||
|
||||
end
|
||||
let(:output) { StringIO.new }
|
||||
|
||||
it "save" do
|
||||
iobj.save.should be_true
|
||||
iobj.dumpXml
|
||||
iobj.dumpXml(1, output)
|
||||
|
||||
output.rewind
|
||||
directory = Nokogiri::XML(output)
|
||||
directory.css('logging accesslog').text.should == "access.log"
|
||||
directory.css('logging errorlog').text.should == "error.log"
|
||||
directory.css('logging loglevel').text.should == "4"
|
||||
directory.css('logging playlistlog').text.should == "playlist.log"
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -3,14 +3,24 @@ require 'spec_helper'
|
|||
describe IcecastPath do
|
||||
|
||||
let(:iobj) { IcecastPath.new }
|
||||
|
||||
before(:all) do
|
||||
|
||||
end
|
||||
let(:output) { StringIO.new }
|
||||
|
||||
it "save" do
|
||||
iobj.save.should be_true
|
||||
iobj.dumpXml
|
||||
iobj.dumpXml(1, output)
|
||||
|
||||
output.rewind
|
||||
directory = Nokogiri::XML(output)
|
||||
directory.css('paths basedir').text.should == "./"
|
||||
directory.css('paths logdir').text.should == "./logs"
|
||||
directory.css('paths pidfile').text.should == "./icecast.pid"
|
||||
directory.css('paths webroot').text.should == "./web"
|
||||
directory.css('paths adminroot').text.should == "./admin"
|
||||
directory.css('paths allow-ip').text.should == "/path/to/ip_allowlist"
|
||||
directory.css('paths deny-ip').text.should == "/path_to_ip_denylist"
|
||||
directory.css('paths alias').text.should == ""
|
||||
#puts directory.css('paths alias').first["source"]
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -3,17 +3,26 @@ require 'spec_helper'
|
|||
describe IcecastSecurity do
|
||||
|
||||
let(:iobj) { IcecastSecurity.new }
|
||||
let(:output) { StringIO.new }
|
||||
|
||||
before(:all) do
|
||||
=begin
|
||||
example output:
|
||||
|
||||
end
|
||||
<security>
|
||||
<chroot>0</chroot>
|
||||
<changeowner>
|
||||
<user>hotdog</user>
|
||||
<group>mongrel</group>
|
||||
<changeowner>
|
||||
</security>
|
||||
|
||||
=end
|
||||
|
||||
it "save" do
|
||||
iobj.changeowner_user ="hotdog"
|
||||
iobj.changeowner_group ="mongrel"
|
||||
iobj.save.should be_true
|
||||
iobj.dumpXml
|
||||
iobj.dumpXml(1, output)
|
||||
end
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ require 'spec_helper'
|
|||
describe IcecastUserAuthentication do
|
||||
|
||||
let(:iobj) { IcecastUserAuthentication.new }
|
||||
let(:output) { StringIO.new }
|
||||
|
||||
before(:all) do
|
||||
|
||||
|
|
@ -11,7 +12,7 @@ describe IcecastUserAuthentication do
|
|||
it "save" do
|
||||
iobj.save
|
||||
#puts iobj.inspect
|
||||
iobj.dumpXml
|
||||
iobj.dumpXml(1, output)
|
||||
iobj.errors.any?.should be_false
|
||||
end
|
||||
|
||||
|
|
@ -23,7 +24,7 @@ describe IcecastUserAuthentication do
|
|||
#puts limit.inspect
|
||||
iobj.filename ="/dfdfd</$%%%6566.auth"
|
||||
iobj.save.should be_true
|
||||
iobj.dumpXml
|
||||
iobj.dumpXml(1, output)
|
||||
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue