Bring back support for 1.9.3

This commit is contained in:
Markus Schirp 2015-01-14 11:04:45 +00:00
parent c16621bb9f
commit 53d487b4b7
7 changed files with 7 additions and 79 deletions

View file

@ -4,12 +4,13 @@ script: "bundle exec rake ci"
env:
- TRAVIS=true
rvm:
- '1.9'
- '2.0'
- '2.1'
- rbx-2
- rbx
matrix:
allow_failures:
- rvm: rbx-2 # travis does not maintain rbx setup correctly
- rvm: rbx
notifications:
irc:
channels:

View file

@ -1,3 +1,3 @@
---
threshold: 18
total_score: 1224
total_score: 1220

View file

@ -218,7 +218,6 @@ require 'mutant/reporter/cli'
require 'mutant/reporter/cli/printer'
require 'mutant/reporter/cli/tput'
require 'mutant/reporter/cli/format'
require 'mutant/line_trace'
require 'mutant/zombifier'
require 'mutant/zombifier/file'

View file

@ -1,34 +0,0 @@
module Mutant
# Line tracer
class LineTrace
include Adamantium::Flat, Concord.new(:contents)
private_class_method :new
# Test if trace coveres file at lineno
#
# @param [String] file
# @param [Fixnum] lineno
#
# @return [Boolean]
#
def cover?(file, lineno)
contents.fetch(file) { return false }.include?(lineno)
end
# Run block
#
# @return [Traces]
#
# @api private
#
def self.call(&block)
traces = Hash.new { |hash, file| hash[file] = Set.new }
TracePoint.trace(:return, :line) do |point|
traces[point.path] << point.lineno
end.tap(&block).disable
new(IceNine.deep_freeze(traces))
end
end # LineTrace
end # Mutant

View file

@ -21,7 +21,7 @@ Gem::Specification.new do |gem|
gem.extra_rdoc_files = %w[TODO LICENSE]
gem.executables = %w[mutant]
gem.required_ruby_version = '>= 2.0.0'
gem.required_ruby_version = '>= 1.9.3'
gem.add_runtime_dependency('parser', '~> 2.2.0.2')
gem.add_runtime_dependency('ast', '~> 2.0')
@ -30,7 +30,7 @@ Gem::Specification.new do |gem|
gem.add_runtime_dependency('morpher', '~> 0.2.3')
gem.add_runtime_dependency('procto', '~> 0.0.2')
gem.add_runtime_dependency('abstract_type', '~> 0.0.7')
gem.add_runtime_dependency('unparser', '~> 0.2.0')
gem.add_runtime_dependency('unparser', '~> 0.2.2')
gem.add_runtime_dependency('ice_nine', '~> 0.11.1')
gem.add_runtime_dependency('adamantium', '~> 0.2.0')
gem.add_runtime_dependency('memoizable', '~> 0.4.2')

View file

@ -1,38 +0,0 @@
RSpec.describe Mutant::LineTrace do
let(:object) { described_class }
test_a_line = __LINE__ + 2
def test_a
test_b
end
test_b_line = __LINE__ + 2
def test_b
end
test_c_line = __LINE__ + 2
def test_c
end
shared_examples_for 'line trace' do
it 'returns correct trace results' do
expect(subject.cover?(__FILE__, test_a_line)).to be(true)
expect(subject.cover?(__FILE__, test_b_line)).to be(true)
expect(subject.cover?(__FILE__, test_c_line)).to be(false)
expect(subject.cover?(__FILE__, __LINE__)).to be(false)
expect(subject.cover?('/dev/null', test_a_line)).to be(false)
end
end
describe '.cover?' do
subject { object.call { test_a } }
include_examples 'line trace'
end
describe '.call' do
subject { object.call { test_a } }
include_examples 'line trace'
end
end

View file

@ -4,6 +4,6 @@ RSpec.describe Mutant::Reporter::Trace do
describe '#delay' do
subject { object.delay }
it { should equal(0.0) }
it { should eql(0.0) }
end
end