Sha256: d43708d4f934946c0fd82a9e857365ccca48172ee06eb7e5afd577cd187fa64c

Contents?: true

Size: 862 Bytes

Versions: 6

Compression:

Stored size: 862 Bytes

Contents

require 'spec_helper'

describe PulseMeter::DygraphsVisualize::DSL::Sensor do
  let(:interval){ 100 }
  let(:name) { "some_sensor" }
  let!(:sensor){ PulseMeter::Sensor::Timelined::Max.new(name, :ttl => 1000, :interval => interval) }

  describe '.new' do
    it "should save passed name and create DygraphsVisualize::Sensor with it" do
      described_class.new(name).to_data.name.to_s.should == name
    end
  end

  describe '#process_args' do
    it "should pass args transparently to DygraphsVisualize::Sensor" do
      s = described_class.new(name)
      s.process_args color: :red
      s.to_data.color.to_s.should == 'red'
    end
  end

  describe '#to_data' do
    # actually tested above
    it "should convert dsl data to sensor" do
      described_class.new(name).to_data.should be_kind_of(PulseMeter::DygraphsVisualize::Sensor)
    end
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pulse_meter-dygraphs_visualizer-0.4.20 spec/pulse_meter/dygraphs_visualize/dsl/sensor_spec.rb
pulse_meter-dygraphs_visualizer-0.4.19 spec/pulse_meter/dygraphs_visualize/dsl/sensor_spec.rb
pulse_meter-dygraphs_visualizer-0.4.18 spec/pulse_meter/dygraphs_visualize/dsl/sensor_spec.rb
pulse_meter-dygraphs_visualizer-0.4.17 spec/pulse_meter/dygraphs_visualize/dsl/sensor_spec.rb
pulse_meter-dygraphs_visualizer-0.4.16 spec/pulse_meter/dygraphs_visualize/dsl/sensor_spec.rb
pulse_meter-dygraphs_visualizer-0.4.15 spec/pulse_meter/dygraphs_visualize/dsl/sensor_spec.rb