Sha256: cbf68f55fbb9322a1c08ef2ede9d010e65d66200c510d3efb14d059ab66b8e85

Contents?: true

Size: 1.16 KB

Versions: 31

Compression:

Stored size: 1.16 KB

Contents

require 'spec_helper'

describe PulseMeter::Visualize::DSL::Widgets::Line do
  it_should_behave_like "dsl widget"

  let(:interval){ 100 }
  let(:name) { "some_sensor" }
  let!(:sensor){ PulseMeter::Sensor::Timelined::Max.new(name, :ttl => 1000, :interval => interval) }
  
  let(:widget_name){ "some_widget" }
  let(:w){ described_class.new(widget_name)  }

  describe "#to_data" do
    it "should produce PulseMeter::Visualize::Widgets::Area class" do
      w.to_data.should be_kind_of(PulseMeter::Visualize::Widgets::Line)
    end
  end

  describe "#values_label" do
    it "should set values_label" do
      w.values_label "some y-axis legend"
      w.to_data.values_label.should == "some y-axis legend"
    end
  end

  describe "#show_last_point" do
    it "should set show_last_point" do
      w.show_last_point true
      w.to_data.show_last_point.should be_true
    end
  end

  describe "#timespan" do
    it "should set timespan" do
      w.timespan 5
      w.to_data.timespan.should == 5
    end
    it "should raise exception if timespan is negative" do
      expect{ w.timespan(-1) }.to raise_exception(PulseMeter::Visualize::DSL::BadWidgetTimeSpan)
    end
  end

end

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
pulse_meter_visualizer-0.4.19 spec/pulse_meter/visualize/dsl/widgets/line_spec.rb
pulse_meter_visualizer-0.4.18 spec/pulse_meter/visualize/dsl/widgets/line_spec.rb
pulse_meter_visualizer-0.4.17 spec/pulse_meter/visualize/dsl/widgets/line_spec.rb
pulse_meter_visualizer-0.4.16 spec/pulse_meter/visualize/dsl/widgets/line_spec.rb
pulse_meter_visualizer-0.4.15 spec/pulse_meter/visualize/dsl/widgets/line_spec.rb
pulse_meter_visualizer-0.4.14 spec/pulse_meter/visualize/dsl/widgets/line_spec.rb
pulse_meter_visualizer-0.4.13 spec/pulse_meter/visualize/dsl/widgets/line_spec.rb
pulse_meter_visualizer-0.4.12 spec/pulse_meter/visualize/dsl/widgets/line_spec.rb
pulse_meter_visualizer-0.4.11 spec/pulse_meter/visualize/dsl/widgets/line_spec.rb
pulse-meter-0.4.9 spec/pulse_meter/visualize/dsl/widgets/line_spec.rb
pulse-meter-0.4.8 spec/pulse_meter/visualize/dsl/widgets/line_spec.rb
pulse-meter-0.4.7 spec/pulse_meter/visualize/dsl/widgets/line_spec.rb
pulse-meter-0.4.6 spec/pulse_meter/visualize/dsl/widgets/line_spec.rb
pulse-meter-0.4.5 spec/pulse_meter/visualize/dsl/widgets/line_spec.rb
pulse-meter-0.4.4 spec/pulse_meter/visualize/dsl/widgets/line_spec.rb
pulse-meter-0.4.3 spec/pulse_meter/visualize/dsl/widgets/line_spec.rb
pulse-meter-0.4.2 spec/pulse_meter/visualize/dsl/widgets/line_spec.rb
pulse-meter-0.4.1 spec/pulse_meter/visualize/dsl/widgets/line_spec.rb
pulse-meter-0.4.0 spec/pulse_meter/visualize/dsl/widgets/line_spec.rb
pulse-meter-0.3.2 spec/pulse_meter/visualize/dsl/widgets/line_spec.rb