Sha256: f1cb276ea97937821b757c493b341e7f24df314c4ea8aa33348bc81b7e1d49bc

Contents?: true

Size: 796 Bytes

Versions: 1

Compression:

Stored size: 796 Bytes

Contents

require 'spec_helper'

describe Mutant::Expression::Namespace::Exact do

  let(:object)            { described_class.parse(input) }
  let(:cache)             { Mutant::Cache.new            }
  let(:input)             { 'TestApp::Literal'           }

  describe '#matcher' do
    subject { object.matcher(cache) }

    it { should eql(Mutant::Matcher::Scope.new(cache, TestApp::Literal)) }
  end

  describe '#match_length' do
    subject { object.match_length(other) }

    context 'when other is an equivalent expression' do
      let(:other) { described_class.parse(object.syntax) }

      it { should be(object.syntax.length) }
    end

    context 'when other is an unequivalent expression' do
      let(:other) { described_class.parse('Foo*') }

      it { should be(0) }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mutant-0.5.24 spec/unit/mutant/expression/namespace/flat_spec.rb