require File.expand_path(File.join(File.dirname(__FILE__), %w[.. spec_helper])) describe Ziya::Gauges::Signal do describe "#initialize" do before( :each ) do @gauge = Ziya::Gauges::Signal.new( "test_license", "override" ) end it "should create a gauge with the correct license" do @gauge.license.should == "test_license" end it "should create a gauge with the correct id" do @gauge.design_id.should == "override" end end describe "#to_xml" do it "should produce the correct xml for the std gauge" do buff = Ziya::Gauges::Signal.new( "test_license" ).to_xml buff.scan( / 6.5 ) buff = gauge.to_xml buff.scan( />(\d\.\d)<\/text>/ ).should == [["6.5"]] end end end