Sha256: 22ddfc6b1c7bedfdc6365564c78a9530b8eb5387201c2d07682f05ddce7ebd21

Contents?: true

Size: 1.03 KB

Versions: 5

Compression:

Stored size: 1.03 KB

Contents

# encoding: utf-8

require 'spec_helper'

describe Mutant::Mutator::Node::Literal, 'float' do

  context 'positive number' do
    let(:source) { '10.0' }

    let(:mutations) do
      mutations = []
      mutations << 'nil'
      mutations << '0.0'
      mutations << '1.0'
      mutations << '(0.0 / 0.0)'
      mutations << '(1.0 / 0.0)'
      mutations << '(-1.0 / 0.0)'
      mutations << '-10.0'
    end

    it_should_behave_like 'a mutator'
  end

  context '0.0' do
    let(:source) { '0.0' }

    let(:mutations) do
      mutations = []
      mutations << 'nil'
      mutations << '1.0'
      mutations << '(0.0 / 0.0)'
      mutations << '(1.0 / 0.0)'
      mutations << '(-1.0 / 0.0)'
    end

    it_should_behave_like 'a mutator'
  end

  context '-0.0' do
    let(:source) { '-0.0' }

    let(:mutations) do
      mutations = []
      mutations << 'nil'
      mutations << '1.0'
      mutations << '(0.0 / 0.0)'
      mutations << '(1.0 / 0.0)'
      mutations << '(-1.0 / 0.0)'
    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/literal/float_spec.rb
mutant-0.5.16 spec/unit/mutant/mutator/node/literal/float_spec.rb
mutant-0.5.15 spec/unit/mutant/mutator/node/literal/float_spec.rb
mutant-0.5.14 spec/unit/mutant/mutator/node/literal/float_spec.rb
mutant-0.5.13 spec/unit/mutant/mutator/node/literal/float_spec.rb