Sha256: 7ba7915abc8d8baec2a792be5cf13af1c953e9b4f072036f2a90a266505169d1

Contents?: true

Size: 677 Bytes

Versions: 2

Compression:

Stored size: 677 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Mutant::Mutator::Node::Generic, 'op_asgn' do
  let(:random_fixnum) { 5 }

  let(:source) { '@a.b += 1' }

  let(:mutations) do
    mutations = []
    mutations << '@a.b += -1'
    mutations << '@a.b += 2'
    mutations << '@a.b += 0'
    mutations << '@a.b += nil'
    mutations << '@a.b += 5'
    mutations << 'nil.b += 1'
    mutations << 'nil'
    # TODO: fix invalid AST
    #   This should not get emitted as invalid AST with valid unparsed source
    mutations << s(:op_asgn, s(:ivar, :@a), :+, s(:int, 1))
  end

  before do
    Mutant::Random.stub(fixnum: random_fixnum)
  end

  it_should_behave_like 'a mutator'
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mutant-0.5.12 spec/unit/mutant/mutator/node/op_assgn_spec.rb
mutant-0.5.11 spec/unit/mutant/mutator/node/op_assgn_spec.rb