Sha256: b86dbb9f18ce3ab345dd25ad9604a4b37b9fbca84f6d8a15445e042403e73349

Contents?: true

Size: 842 Bytes

Versions: 93

Compression:

Stored size: 842 Bytes

Contents

require 'spec_helper'

module Itamae
  describe Resource do
    describe ".get_resource_class_name" do
      let(:method) { :foo_bar_baz }
      it "returns camel-cased string" do
        expect(described_class.get_resource_class_name(method)).
          to eq("FooBarBaz")
      end
    end

    describe ".parse_description" do
      context "with valid description" do
        it "returns type and name" do
          expect(described_class.parse_description("this-is_type[this-is_name]")).
            to eq(["this-is_type", "this-is_name"])
        end
      end

      context "with invalid description" do
        it "raises an error" do
          expect do
            described_class.parse_description("[this-is_type][this-is_name]")
          end.to raise_error(Itamae::Resource::ParseError)
        end
      end
    end
  end
end

Version data entries

93 entries across 93 versions & 1 rubygems

Version Path
itamae-1.0.0.beta34 spec/unit/lib/itamae/resource_spec.rb
itamae-1.0.0.beta33 spec/unit/lib/itamae/resource_spec.rb
itamae-1.0.0.beta32 spec/unit/lib/itamae/resource_spec.rb
itamae-1.0.0.beta31 spec/unit/lib/itamae/resource_spec.rb
itamae-1.0.0.beta30 spec/unit/lib/itamae/resource_spec.rb
itamae-1.0.0.beta29 spec/unit/lib/itamae/resource_spec.rb
itamae-1.0.0.beta28 spec/unit/lib/itamae/resource_spec.rb
itamae-1.0.0.beta27 spec/unit/lib/itamae/resource_spec.rb
itamae-1.0.0.beta26 spec/unit/lib/itamae/resource_spec.rb
itamae-1.0.0.beta25 spec/unit/lib/itamae/resource_spec.rb
itamae-1.0.0.beta24 spec/unit/lib/itamae/resource_spec.rb
itamae-1.0.0.beta23 spec/unit/lib/itamae/resource_spec.rb
itamae-1.0.0.beta22 spec/unit/lib/itamae/resource_spec.rb
itamae-1.0.0.beta21 spec/unit/lib/itamae/resource_spec.rb
itamae-1.0.0.beta20 spec/unit/lib/itamae/resource_spec.rb
itamae-1.0.0.beta19 spec/unit/lib/itamae/resource_spec.rb
itamae-1.0.0.beta18 spec/unit/lib/itamae/resource_spec.rb
itamae-1.0.0.beta17 spec/unit/lib/itamae/resource_spec.rb
itamae-1.0.0.beta16 spec/unit/lib/itamae/resource_spec.rb
itamae-1.0.0.beta15 spec/unit/lib/itamae/resource_spec.rb