From b6964574cdf7b7554d7bee228cd7f42643a7f0fc Mon Sep 17 00:00:00 2001 From: Dan Kubb Date: Sun, 28 Jul 2013 16:39:23 -0700 Subject: [PATCH] Upgrade unparser gem dependency * Fix failing "canary" specs * Not all mutations can be performed yet for rescue, but this is an improvement since it does not raise an exception. --- mutant.gemspec | 2 +- .../mutator/node/rescue/mutation_spec.rb | 20 ++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/mutant.gemspec b/mutant.gemspec index 5ac7df1e..1918e526 100644 --- a/mutant.gemspec +++ b/mutant.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |gem| gem.executables = %w[mutant] gem.add_runtime_dependency('parser', '~> 2.0.0.pre3') - gem.add_runtime_dependency('unparser', '~> 0.0.10') + gem.add_runtime_dependency('unparser', '~> 0.0.11') gem.add_runtime_dependency('ice_nine', '~> 0.8.0') gem.add_runtime_dependency('descendants_tracker', '~> 0.0.1') gem.add_runtime_dependency('adamantium', '~> 0.0.10') diff --git a/spec/unit/mutant/mutator/node/rescue/mutation_spec.rb b/spec/unit/mutant/mutator/node/rescue/mutation_spec.rb index 91f6d14f..8ab1363a 100644 --- a/spec/unit/mutant/mutator/node/rescue/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/rescue/mutation_spec.rb @@ -3,18 +3,20 @@ require 'spec_helper' describe Mutant::Mutator::Node::Generic, 'rescue' do - let(:source) { 'begin; rescue Exception => e; end' } - let(:mutations) { [] } + let(:source) { 'begin; rescue Exception => e; end' } - # TODO: remove once unparser is fixed - it 'does not raise an exception when unparsing source' do - pending 'unparser bug' do - expect { Unparser.unparse(Parser::CurrentRuby.parse(source)) } - .to_not raise_error - end + let(:mutations) do + mutations = [] + mutations << 'begin; rescue Exception => srandom; end' + mutations << 'begin; rescue nil => e; end' + mutations << 'begin; rescue => e; end' end - pending 'unparser bug' do + before do + Mutant::Random.stub(:hex_string => 'random') + end + + pending do it_should_behave_like 'a mutator' end end