Sha256: 6b9d1b858fda32f866b504488c15121743bb008dc78db1b11bde49707440a93c

Contents?: true

Size: 1.39 KB

Versions: 8

Compression:

Stored size: 1.39 KB

Contents

RSpec.describe Mutest::Matcher::Config do
  describe '#inspect' do
    subject { object.inspect }

    context 'on default config' do
      let(:object) { described_class::DEFAULT }

      it { is_expected.to eql('#<Mutest::Matcher::Config empty>') }
    end

    context 'with one expression' do
      let(:object) { described_class::DEFAULT.add(:match_expressions, parse_expression('Foo')) }
      it { is_expected.to eql('#<Mutest::Matcher::Config match_expressions: [Foo]>') }
    end

    context 'with many expressions' do
      let(:object) do
        described_class::DEFAULT
          .add(:match_expressions, parse_expression('Foo'))
          .add(:match_expressions, parse_expression('Bar'))
      end

      it { is_expected.to eql('#<Mutest::Matcher::Config match_expressions: [Foo,Bar]>') }
    end

    context 'with match and ignore expression' do
      let(:object) do
        described_class::DEFAULT
          .add(:match_expressions,  parse_expression('Foo'))
          .add(:ignore_expressions, parse_expression('Bar'))
      end

      it { is_expected.to eql('#<Mutest::Matcher::Config ignore_expressions: [Bar] match_expressions: [Foo]>') }
    end

    context 'with subject filter' do
      let(:object) do
        described_class::DEFAULT
          .add(:subject_filters, 'foo')
      end

      it { is_expected.to eql('#<Mutest::Matcher::Config subject_filters: ["foo"]>') }
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mutest-0.0.9 spec/unit/mutest/matcher/config_spec.rb
mutest-0.0.8 spec/unit/mutest/matcher/config_spec.rb
mutest-0.0.7 spec/unit/mutest/matcher/config_spec.rb
mutest-0.0.6 spec/unit/mutest/matcher/config_spec.rb
mutest-0.0.5 spec/unit/mutest/matcher/config_spec.rb
mutest-0.0.4 spec/unit/mutest/matcher/config_spec.rb
mutest-0.0.3 spec/unit/mutest/matcher/config_spec.rb
mutest-0.0.2 spec/unit/mutest/matcher/config_spec.rb