Sha256: 4efbf93ae2ce61ae34608539420326c0fa94aef5cd0f708f7907651cc100c6b9

Contents?: true

Size: 647 Bytes

Versions: 12

Compression:

Stored size: 647 Bytes

Contents

require 'spec_helper'

describe Mutant::Mutator, 'begin' do

  # This mutation and only this mutation can result in
  # and empty emit that is parsed into nil, unparser cannot
  # handle this so we guard this here!
  def generate(node)
    return '' if node.nil?
    super
  end

  let(:source) { "true\nfalse" }

  let(:mutations) do
    mutations = []

    # Mutation of each statement in block
    mutations << "true\ntrue"
    mutations << "false\nfalse"
    mutations << "nil\nfalse"
    mutations << "true\nnil"

    # Remove statement in block
    mutations << 'true'
    mutations << 'false'
  end

  it_should_behave_like 'a mutator'
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
mutant-0.3.0.beta21 spec/unit/mutant/mutator/node/begin/mutation_spec.rb
mutant-0.3.0.beta20 spec/unit/mutant/mutator/node/begin/mutation_spec.rb
mutant-0.3.0.beta19 spec/unit/mutant/mutator/node/begin/mutation_spec.rb
mutant-0.3.0.beta18 spec/unit/mutant/mutator/node/begin/mutation_spec.rb
mutant-0.3.0.beta17 spec/unit/mutant/mutator/node/begin/mutation_spec.rb
mutant-0.3.0.beta16 spec/unit/mutant/mutator/node/begin/mutation_spec.rb
mutant-0.3.0.beta15 spec/unit/mutant/mutator/node/begin/mutation_spec.rb
mutant-0.3.0.beta14 spec/unit/mutant/mutator/node/begin/mutation_spec.rb
mutant-0.3.0.beta13 spec/unit/mutant/mutator/node/begin/mutation_spec.rb
mutant-0.3.0.beta12 spec/unit/mutant/mutator/node/begin/mutation_spec.rb
mutant-0.3.0.beta11 spec/unit/mutant/mutator/node/begin/mutation_spec.rb
mutant-0.3.0.beta10 spec/unit/mutant/mutator/node/begin/mutation_spec.rb