Sha256: 4912ecbc919d76ca93c1c71b77ddf9b6869df2a2c1b754888116d45513fd0fa1

Contents?: true

Size: 906 Bytes

Versions: 20

Compression:

Stored size: 906 Bytes

Contents

require 'spec_helper'

describe Mutant::Mutator::Node::Literal, 'hash' do
  let(:source) { '{true => true, false => false}' }

  let(:mutations) do
    mutations = []

    # Literal replaced with nil
    mutations << 'nil'

    # Mutation of each key and value in hash
    mutations << '{ false => true  ,  false => false }'
    mutations << '{ nil   => true  ,  false => false }'
    mutations << '{ true  => false ,  false => false }'
    mutations << '{ true  => nil   ,  false => false }'
    mutations << '{ true  => true  ,  true  => false }'
    mutations << '{ true  => true  ,  nil   => false }'
    mutations << '{ true  => true  ,  false => true  }'
    mutations << '{ true  => true  ,  false => nil   }'

    # Remove each key once
    mutations << '{ true => true }'
    mutations << '{ false => false }'

    # Empty hash
    mutations << '{}'
  end

  it_should_behave_like 'a mutator'
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
mutant-0.3.0.beta21 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.3.0.beta20 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.3.0.beta19 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.3.0.beta18 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.3.0.beta17 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.3.0.beta16 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.3.0.beta15 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.3.0.beta14 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.3.0.beta13 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.3.0.beta12 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.3.0.beta11 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.3.0.beta10 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.3.0.beta9 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.3.0.beta8 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.3.0.beta7 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.3.0.beta6 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.3.0.beta5 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.3.0.beta4 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.3.0.beta3 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.3.0.beta2 spec/unit/mutant/mutator/node/literal/hash_spec.rb