Sha256: a28242dd93b87102d36ce0a249081fbfb3b3adc9f83e4c08888670609d677dea

Contents?: true

Size: 949 Bytes

Versions: 1

Compression:

Stored size: 949 Bytes

Contents

shared_examples 'Prefix' do

  let(:described) { described_class.new 'test', { prefix: 'prefix' } }

  describe "#match?" do
    subject { described.match?(name) }
    context "when name match name with prefix" do
      let(:name) { 'prefix_test'}
      it { should be true }
    end

    context "when name match name without prefix" do
      let(:name) { 'test'}
      it { should be true }
    end

    context "when name do not match" do
      let(:name) { 'something'}
      it { should be false }
    end
  end

  describe "#name_with_prefix" do
    subject { described.name_with_prefix }

    it { should be_eql 'prefix_test' }
  end

  describe "#prefix" do
    subject { described.prefix }

    it { should be_eql 'prefix' }
  end

  describe "#name_without_prefix" do
    let(:described) { described_class.new 'prefix_test', { prefix: 'prefix' } }

    subject { described.name_without_prefix }

    it { should be_eql 'test' }
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
signable-0.0.1 spec/support/concerns/prefix.rb