Skip to content

Instantly share code, notes, and snippets.

@snusnu
Created August 3, 2013 02:34
Show Gist options
  • Save snusnu/6144875 to your computer and use it in GitHub Desktop.
Save snusnu/6144875 to your computer and use it in GitHub Desktop.
Possible bug in mutant
require 'concord'
class Request
include Concord.new(:input)
end
class Response
include Concord.new(:input, :output)
def to_request(new_input = output)
Request.new(new_input)
end
end
require 'rspec'
describe Response, '#to_request' do
let(:object) { Response.new(input, output) }
let(:input) { double('input') }
let(:output) { double('output') }
let(:expected) { Request.new(new_input) }
# How come mutant thinks this spec kills all mutations?
context 'when no new input is given' do
subject { object.to_request }
let(:new_input) { output }
it { should eql(expected) }
end
# I think the following context is also needed
# context 'when new input is given' do
# subject { object.to_request(new_input) }
# let(:new_input) { double('new_input') }
# it { should eql(expected) }
# end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment