Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 190c48de2f
Fetching contributors…

Cannot retrieve contributors at this time

52 lines (44 sloc) 1.264 kb
require 'spec_helper'
describe 'Mutating string' do
context 'for a singleton method' do
context 'that contains "foo"' do
before do
write_file 'thing.rb', """
class Thing
def self.a_string
'foo'
end
end
"""
end
context 'with an expectation that the return value is "foo"' do
before do
write_file 'spec/thing_spec.rb', """
require 'thing'
describe 'Thing.a_string' do
specify { Thing.a_string.should eq('foo') }
end
"""
mutate 'Thing.a_string spec/thing_spec.rb'
end
specify 'the mutation passes' do
all_output.should include('passed')
end
end
context 'with an expectation that the return value is a string' do
before do
write_file 'spec/thing_spec.rb', """
require 'thing'
describe 'Thing.a_string' do
specify { Thing.a_string.should be_a(String) }
end
"""
mutate 'Thing.a_string spec/thing_spec.rb'
end
specify 'the mutation fails' do
all_output.should include('failed')
end
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.