Sha256: d69f3b21d756b7c089009575fb372f0bab941117689d2af5b03e2c7a6ec1a845

Contents?: true

Size: 1.16 KB

Versions: 7

Compression:

Stored size: 1.16 KB

Contents

require 'spec_helper'

describe WhippedCream::Plugin do
  subject(:plugin) { described_class.new }

  its(:camera) { should be_nil }
  its(:name) { should be_nil }

  its(:controls) { should be_empty }

  its(:buttons) { should be_empty }
  its(:fields) { should be_empty }
  its(:sensors) { should be_empty }
  its(:switches) { should be_empty }

  describe ".build" do
    it "delegates to Builder" do
      block = -> {}
      expect(WhippedCream::Builder).to receive(:build).with(&block)
      described_class.build(&block)
    end
  end

  describe ".from_file" do
    it "delegates to Builder" do
      path = "foo/bar"
      expect(WhippedCream::Builder).to receive(:from_file).with(path)
      described_class.from_file(path)
    end
  end

  describe ".from_string" do
    it "delegates to Builder" do
      string = "name 'Garage'"
      expect(WhippedCream::Builder).to receive(:from_string).with(string)
      described_class.from_string(string)
    end
  end

  context "with a button" do
    before do
      plugin.controls << WhippedCream::Button.new("Open/Close")
    end

    its(:controls) { should_not be_empty }
    its(:buttons) { should_not be_empty }
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
whipped-cream-0.1.0 spec/lib/whipped-cream/plugin_spec.rb
whipped-cream-0.0.1 spec/lib/whipped-cream/plugin_spec.rb
whipped-cream-0.0.1pre5 spec/lib/whipped-cream/plugin_spec.rb
whipped-cream-0.0.1pre4 spec/lib/whipped-cream/plugin_spec.rb
whipped-cream-0.0.1pre3 spec/lib/whipped-cream/plugin_spec.rb
whipped-cream-0.0.1pre2 spec/lib/whipped-cream/plugin_spec.rb
whipped-cream-0.0.1pre1 spec/lib/whipped-cream/plugin_spec.rb