free_mutant/spec/unit/mutant/mutator/literal/regex_spec.rb
2012-08-01 15:08:29 +02:00

23 lines
469 B
Ruby

require 'spec_helper'
describe Mutant::Mutator::Literal, 'regex' do
let(:random_string) { 'bar' }
let(:source) { '/foo/' }
let(:base_mutations) do
mutations = []
mutations << 'nil'
mutations << "/#{random_string}/"
mutations << '//' # match all
mutations << '/a\A/' # match nothing
end
before do
Mutant::Random.stub(:hex_string => random_string)
end
let(:mutations) { base_mutations }
it_should_behave_like 'a mutator'
end