Sha256: 01dc56d92f9a92980f99c7f1c2b24f2ddf0ef1da20102673b5e0f873e6c6f925

Contents?: true

Size: 1.26 KB

Versions: 5

Compression:

Stored size: 1.26 KB

Contents

# encoding: utf-8

require 'spec_helper'

describe Mutant::Mutator::Node::NamedValue::VariableAssignment, 'mutations' do
  context 'global variable' do
    let(:source) { '$a = true' }

    let(:mutations) do
      mutations = []
      mutations << '$a__mutant__ = true'
      mutations << '$a = false'
      mutations << '$a = nil'
      mutations << 'nil'
    end

    it_should_behave_like 'a mutator'
  end

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

    let(:mutations) do
      mutations = []
      mutations << '@@a__mutant__ = true'
      mutations << '@@a = false'
      mutations << '@@a = nil'
      mutations << 'nil'
    end

    it_should_behave_like 'a mutator'
  end

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

    let(:mutations) do
      mutations = []
      mutations << '@a__mutant__ = true'
      mutations << '@a = false'
      mutations << '@a = nil'
      mutations << 'nil'
    end

    it_should_behave_like 'a mutator'
  end

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

    let(:mutations) do
      mutations = []
      mutations << 'a__mutant__ = true'
      mutations << 'a = false'
      mutations << 'a = nil'
      mutations << 'nil'
    end

    it_should_behave_like 'a mutator'
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mutant-0.5.17 spec/unit/mutant/mutator/node/named_value/variable_assignment_spec.rb
mutant-0.5.16 spec/unit/mutant/mutator/node/named_value/variable_assignment_spec.rb
mutant-0.5.15 spec/unit/mutant/mutator/node/named_value/variable_assignment_spec.rb
mutant-0.5.14 spec/unit/mutant/mutator/node/named_value/variable_assignment_spec.rb
mutant-0.5.13 spec/unit/mutant/mutator/node/named_value/variable_assignment_spec.rb