Sha256: a9fc149da35989115d5eb4b2b3366dbffc4953aece5bbd2035e2052e33dd73d1
Contents?: true
Size: 1.38 KB
Versions: 20
Compression:
Stored size: 1.38 KB
Contents
require 'spec_helper' describe Riddle::Configuration::XMLSource do it "should be invalid without an xmlpipe command, name and type if there's no parent" do source = Riddle::Configuration::XMLSource.new("xml1", "xmlpipe") source.should_not be_valid source.xmlpipe_command = "ls /var/null" source.should be_valid source.name = nil source.should_not be_valid source.name = "xml1" source.type = nil source.should_not be_valid end it "should be invalid without only a name and type if there is a parent" do source = Riddle::Configuration::XMLSource.new("xml1", "xmlpipe") source.should_not be_valid source.parent = "xmlparent" source.should be_valid source.name = nil source.should_not be_valid source.name = "xml1" source.type = nil source.should_not be_valid end it "should raise a ConfigurationError if rendering when not valid" do source = Riddle::Configuration::XMLSource.new("xml1", "xmlpipe") lambda { source.render }.should raise_error(Riddle::Configuration::ConfigurationError) end it "should render correctly when valid" do source = Riddle::Configuration::XMLSource.new("xml1", "xmlpipe") source.xmlpipe_command = "ls /var/null" source.render.should == <<-XMLSOURCE source xml1 { type = xmlpipe xmlpipe_command = ls /var/null } XMLSOURCE end end
Version data entries
20 entries across 20 versions & 1 rubygems