Sha256: d5e54c88494453f50855947984880199302cc80ccd7585879ebdb7d54805ed08

Contents?: true

Size: 764 Bytes

Versions: 2

Compression:

Stored size: 764 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Mutant::Mutator::Node::Literal, 'range' do
  context 'inclusive range literal' do
    let(:source) { '1..100' }

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

    it_should_behave_like 'a mutator'
  end

  context 'exclusive range literal' do
    let(:source) { '1...100' }

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

    it_should_behave_like 'a mutator'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mutant-0.3.0.rc1 spec/unit/mutant/mutator/node/literal/range_spec.rb
mutant-0.3.0.beta22 spec/unit/mutant/mutator/node/literal/range_spec.rb