Sha256: 939bf6d58d2399b69ce404c5b6a19459df1a0bbc796e8499729685f88933686f

Contents?: true

Size: 903 Bytes

Versions: 22

Compression:

Stored size: 903 Bytes

Contents

describe "repetitive definitions" do
  context "of params" do
    subject do
      class Test::Foo
        extend Dry::Initializer::Mixin

        param :foo
        param :bar
        param :foo
      end
    end

    it "raise SyntaxError" do
      expect { subject }.to raise_error SyntaxError, /foo/
    end
  end

  context "of options" do
    subject do
      class Test::Foo
        extend Dry::Initializer::Mixin

        option :foo
        option :bar
        option :foo
      end
    end

    it "raise SyntaxError" do
      expect { subject }.to raise_error SyntaxError, /foo/
    end
  end

  context "of param and option" do
    subject do
      class Test::Foo
        extend Dry::Initializer::Mixin

        param  :foo
        option :bar
        option :foo
      end
    end

    it "raise SyntaxError" do
      expect { subject }.to raise_error SyntaxError, /foo/
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
dry-initializer-0.11.0 spec/repetitive_definitions_spec.rb
dry-initializer-0.10.2 spec/repetitive_definitions_spec.rb
dry-initializer-0.10.1 spec/repetitive_definitions_spec.rb
dry-initializer-0.10.0 spec/repetitive_definitions_spec.rb
dry-initializer-0.9.3 spec/repetitive_definitions_spec.rb
dry-initializer-0.9.2 spec/repetitive_definitions_spec.rb
dry-initializer-0.9.1 spec/repetitive_definitions_spec.rb
dry-initializer-0.9.0 spec/repetitive_definitions_spec.rb
dry-initializer-0.8.1 spec/repetitive_definitions_spec.rb
dry-initializer-0.8.0 spec/repetitive_definitions_spec.rb
dry-initializer-0.7.0 spec/dry/repetitive_definitions_spec.rb
dry-initializer-0.6.0 spec/dry/repetitive_definitions_spec.rb
dry-initializer-0.5.0 spec/dry/repetitive_definitions_spec.rb
dry-initializer-0.4.0 spec/dry/repetitive_definitions_spec.rb
dry-initializer-0.3.3 spec/dry/repetitive_definitions_spec.rb
dry-initializer-0.3.2 spec/dry/repetitive_definitions_spec.rb
dry-initializer-0.3.1 spec/dry/repetitive_definitions_spec.rb
dry-initializer-0.3.0 spec/dry/repetitive_definitions_spec.rb
dry-initializer-0.2.1 spec/dry/repetitive_definitions_spec.rb
dry-initializer-0.2.0 spec/dry/repetitive_definitions_spec.rb