Sha256: 845b9fad1b9b34298ab1e94c8bd2d42ed570b651e0214843a921b9b68277c432

Contents?: true

Size: 1.11 KB

Versions: 16

Compression:

Stored size: 1.11 KB

Contents

# encoding: utf-8

require 'spec_helper'

describe Mutant::Mutator::Node::ConditionalLoop do

  context 'with while statement' do
    let(:source) { 'while true; foo; bar; end' }

    let(:mutations) do
      mutations = []
      mutations << 'while true; bar; end'
      mutations << 'while true; foo; end'
      mutations << 'while true; end'
      mutations << 'while false; foo; bar; end'
      mutations << 'while nil;   foo; bar; end'
      mutations << 'while true;  foo; nil; end'
      mutations << 'while true;  nil; bar; end'
      mutations << 'nil'
    end

    it_should_behave_like 'a mutator'
  end

  context 'with until statement' do
    let(:source) { 'until true; foo; bar; end' }

    let(:mutations) do
      mutations = []
      mutations << 'until true; bar; end'
      mutations << 'until true; foo; end'
      mutations << 'until true; end'
      mutations << 'until false; foo; bar; end'
      mutations << 'until nil;   foo; bar; end'
      mutations << 'until true;  foo; nil; end'
      mutations << 'until true;  nil; bar; end'
      mutations << 'nil'
    end

    it_should_behave_like 'a mutator'
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
mutant-0.5.10 spec/unit/mutant/mutator/node/conditional_loop_spec.rb
mutant-0.5.9 spec/unit/mutant/mutator/node/conditional_loop_spec.rb
mutant-0.5.8 spec/unit/mutant/mutator/node/conditional_loop_spec.rb
mutant-0.5.7 spec/unit/mutant/mutator/node/conditional_loop_spec.rb
mutant-0.5.6 spec/unit/mutant/mutator/node/conditional_loop_spec.rb
mutant-0.5.5 spec/unit/mutant/mutator/node/conditional_loop_spec.rb
mutant-0.5.4 spec/unit/mutant/mutator/node/conditional_loop_spec.rb
mutant-0.5.3 spec/unit/mutant/mutator/node/conditional_loop_spec.rb
mutant-0.5.2 spec/unit/mutant/mutator/node/conditional_loop_spec.rb
mutant-0.5.1 spec/unit/mutant/mutator/node/conditional_loop_spec.rb
mutant-0.5.0 spec/unit/mutant/mutator/node/conditional_loop_spec.rb
mutant-0.3.6 spec/unit/mutant/mutator/node/conditional_loop_spec.rb
mutant-0.3.5 spec/unit/mutant/mutator/node/conditional_loop_spec.rb
mutant-0.3.4 spec/unit/mutant/mutator/node/conditional_loop_spec.rb
mutant-0.3.3 spec/unit/mutant/mutator/node/conditional_loop_spec.rb
mutant-0.3.2 spec/unit/mutant/mutator/node/conditional_loop_spec.rb