Sha256: d22973b2ab8d791e993fd685fa41bf1461e5e31f1a9f4759001bbc0b1ebf8f82

Contents?: true

Size: 925 Bytes

Versions: 31

Compression:

Stored size: 925 Bytes

Contents

# encoding: utf-8

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

31 entries across 31 versions & 1 rubygems

Version Path
mutant-0.5.17 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.5.16 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.5.15 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.5.14 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.5.13 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.5.12 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.5.11 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.5.10 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.5.9 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.5.8 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.5.7 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.5.6 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.5.5 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.5.4 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.5.3 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.5.2 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.5.1 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.5.0 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.3.6 spec/unit/mutant/mutator/node/literal/hash_spec.rb
mutant-0.3.5 spec/unit/mutant/mutator/node/literal/hash_spec.rb