Sha256: d3a1458ae751b1f3faff2740313ecca195e3174b64d464809864fc10ca8f2c4c
Contents?: true
Size: 1.68 KB
Versions: 22
Compression:
Stored size: 1.68 KB
Contents
# encoding: utf-8 require 'spec_helper' describe Mutant::Mutator::Node::NamedValue::Access, 'mutations' do before do Mutant::Random.stub(hex_string: 'random') end context 'global variable' do let(:source) { '$a = nil; $a' } let(:mutations) do mutants = [] mutants << '$a = nil; nil' mutants << '$a = nil' mutants << '$a' mutants << '$a = ::Object.new; $a' mutants << '$srandom = nil; $a' mutants << 'nil; $a' end it_should_behave_like 'a mutator' end context 'class variable' do let(:source) { '@@a = nil; @@a' } let(:mutations) do mutants = [] mutants << '@@a = nil; nil' mutants << '@@a = nil' mutants << '@@a' mutants << '@@a = ::Object.new; @@a' mutants << '@@srandom = nil; @@a' mutants << 'nil; @@a' end end context 'instance variable' do let(:source) { '@a = nil; @a' } let(:mutations) do mutants = [] mutants << '@a = nil; nil' mutants << '@a = nil' mutants << '@a' mutants << '@a = ::Object.new; @a' mutants << '@srandom = nil; @a' mutants << 'nil; @a' end it_should_behave_like 'a mutator' end context 'local variable' do let(:source) { 'a = nil; a' } let(:mutations) do mutants = [] mutants << 'a = nil; nil' mutants << 'a = nil' mutants << 'a' mutants << 'a = ::Object.new; a' mutants << 'srandom = nil; a' mutants << 'nil; a' end it_should_behave_like 'a mutator' end context 'self' do let(:source) { 'self' } let(:mutations) do mutants = [] mutants << 'nil' end it_should_behave_like 'a mutator' end end
Version data entries
22 entries across 22 versions & 1 rubygems