Sha256: dcd67c86f77d8739a60b40de13e275f2f1f4d8ff415c3d7f3bf66e1cd42062e0

Contents?: true

Size: 1.18 KB

Versions: 27

Compression:

Stored size: 1.18 KB

Contents

require 'spec_helper'

describe Mutant::Mutator::Node::Assignment, 'mutations' do

  before do
    Mutant::Random.stub(:hex_string => :random)
  end

  context 'global variable' do
    let(:source) { '$a = true' }

    let(:mutations) do
      mutations = []

      mutations << '$srandom = true'
      mutations << '$a = false'
      mutations << '$a = nil'
    end

    it_should_behave_like 'a mutator'
  end

  context 'class variable' do
    let(:source) { '@@a = true' }

    let(:mutations) do
      mutations = []

      mutations << '@@srandom = true'
      mutations << '@@a = false'
      mutations << '@@a = nil'
    end

    it_should_behave_like 'a mutator'
  end

  context 'instance variable' do
    let(:source) { '@a = true' }

    let(:mutations) do
      mutations = []

      mutations << '@srandom = true'
      mutations << '@a = false'
      mutations << '@a = nil'
    end

    it_should_behave_like 'a mutator'
  end

  context 'local variable' do
    let(:source) { 'a = true' }

    let(:mutations) do
      mutations = []

      mutations << 'srandom = true'
      mutations << 'a = false'
      mutations << 'a = nil'
    end

    it_should_behave_like 'a mutator'
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
mutant-0.3.0.beta19 spec/unit/mutant/mutator/node/assignment/mutation_spec.rb
mutant-0.3.0.beta18 spec/unit/mutant/mutator/node/assignment/mutation_spec.rb
mutant-0.3.0.beta17 spec/unit/mutant/mutator/node/assignment/mutation_spec.rb
mutant-0.3.0.beta16 spec/unit/mutant/mutator/node/assignment/mutation_spec.rb
mutant-0.3.0.beta15 spec/unit/mutant/mutator/node/assignment/mutation_spec.rb
mutant-0.3.0.beta14 spec/unit/mutant/mutator/node/assignment/mutation_spec.rb
mutant-0.3.0.beta13 spec/unit/mutant/mutator/node/assignment/mutation_spec.rb
mutant-0.3.0.beta12 spec/unit/mutant/mutator/node/assignment/mutation_spec.rb
mutant-0.3.0.beta11 spec/unit/mutant/mutator/node/assignment/mutation_spec.rb
mutant-0.3.0.beta10 spec/unit/mutant/mutator/node/assignment/mutation_spec.rb
mutant-0.3.0.beta9 spec/unit/mutant/mutator/node/assignment/mutation_spec.rb
mutant-0.3.0.beta8 spec/unit/mutant/mutator/node/assignment/mutation_spec.rb
mutant-0.3.0.beta7 spec/unit/mutant/mutator/node/assignment/mutation_spec.rb
mutant-0.3.0.beta6 spec/unit/mutant/mutator/node/assignment/mutation_spec.rb
mutant-0.3.0.beta5 spec/unit/mutant/mutator/node/assignment/mutation_spec.rb
mutant-0.3.0.beta4 spec/unit/mutant/mutator/node/assignment/mutation_spec.rb
mutant-0.3.0.beta3 spec/unit/mutant/mutator/node/assignment/mutation_spec.rb
mutant-0.3.0.beta2 spec/unit/mutant/mutator/node/assignment/mutation_spec.rb
mutant-0.2.20 spec/unit/mutant/mutator/node/assignment/mutation_spec.rb
mutant-0.2.17 spec/unit/mutant/mutator/node/assignment/mutation_spec.rb