Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 83cb1b4992
Fetching contributors…

Cannot retrieve contributors at this time

47 lines (39 sloc) 1.065 kB
require 'spec_helper'
describe 'Mutating a class' do
before do
write_file 'thing.rb', """
class Thing
def alive?; true end
def dead?; false end
def mood; :happy end
def gender; 'male' end
def alphabet_range; 'a'..'k' end
end
"""
write_file 'spec/thing_spec.rb', """
$: << '.'
require 'thing'
describe Thing do
describe '#alive?' do
specify { Thing.new.should be_alive }
end
describe '#dead?' do
specify { Thing.new.should_not be_dead }
end
describe '#mood' do
specify { Thing.new.mood.should eq(:happy) }
end
describe '#gender' do
specify { Thing.new.gender.should eq('male') }
end
describe '#alphabet_range' do
specify { Thing.new.alphabet_range.should eq('a'..'k') }
end
end
"""
run_simple '../../bin/mutate Thing spec/thing_spec.rb'
end
it 'runs all possible mutations' do
all_output.should include('passed')
end
end
Jump to Line
Something went wrong with that request. Please try again.