Sha256: 7a2214d2a35a12803305f8b99b34d3b291c0ee0a25b800584cd7290f9c85fb6a

Contents?: true

Size: 665 Bytes

Versions: 2

Compression:

Stored size: 665 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Mutant::Mutator::Node::Literal, 'regex' do

  context 'literal' do
    let(:source) { '/foo/' }

    let(:mutations) do
      mutations = []
      mutations << 'nil'
      mutations << '//' # match all
      mutations << '/a\A/' # match nothing
    end

    it_should_behave_like 'a mutator'
  end

  context 'interpolated' do
    let(:source) { '/#{foo.bar}n/' }

    let(:mutations) do
      mutations = []
      mutations << 'nil'
      mutations << '//' # match all
      mutations << '/#{foo}n/' # match all
      mutations << '/a\A/' # match nothing
    end

    it_should_behave_like 'a mutator'
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mutant-0.3.0.rc1 spec/unit/mutant/mutator/node/literal/regex_spec.rb
mutant-0.3.0.beta22 spec/unit/mutant/mutator/node/literal/regex_spec.rb