Sha256: f779e93ffb2693cb5f04c149dbffe75a7f7c02199745064f22e96d0456f4fb4c

Contents?: true

Size: 742 Bytes

Versions: 3

Compression:

Stored size: 742 Bytes

Contents

require "spec_helper"

describe Docks::Containers do
  subject { Docks::Containers }

  describe ".container_for" do
    it "wraps a parse result in the correct container" do
      subject::TOP_LEVEL_SYMBOLS.each do |type|
        container = subject.constants.map { |const| subject.const_get(const) }.select { |const| const.respond_to?(:type) && const.type == type }.first
        expect(subject.container_for(type)).to be container
      end
    end

    it "returns the base symbol if no type was passed" do
      expect(subject.container_for).to be Docks::Containers::Symbol
    end

    it "returns the base symbol for an unrecognized type" do
      expect(subject.container_for("foo")).to be Docks::Containers::Symbol
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
docks_app-0.0.3 spec/lib/containers_spec.rb
docks_app-0.0.2 spec/lib/containers_spec.rb
docks_app-0.0.1 spec/lib/containers_spec.rb