2013-07-28 19:03:06 -04:00
|
|
|
# encoding: utf-8
|
|
|
|
|
2013-01-01 17:28:21 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Mutant::Mutator, 'super' do
|
|
|
|
|
2013-01-01 19:04:16 -05:00
|
|
|
context 'with no arguments' do
|
2013-01-01 17:28:21 -05:00
|
|
|
let(:source) { 'super' }
|
|
|
|
|
2013-07-23 04:02:29 -04:00
|
|
|
let(:mutations) do
|
|
|
|
mutations = []
|
|
|
|
mutations << 'nil'
|
|
|
|
end
|
|
|
|
|
|
|
|
it_should_behave_like 'a mutator'
|
2013-01-01 17:28:21 -05:00
|
|
|
end
|
|
|
|
|
2013-01-01 19:04:16 -05:00
|
|
|
context 'with explicit empty arguments' do
|
2013-01-01 17:28:21 -05:00
|
|
|
let(:source) { 'super()' }
|
|
|
|
|
|
|
|
let(:mutations) do
|
|
|
|
mutations = []
|
|
|
|
mutations << 'super'
|
2013-09-08 02:10:25 -04:00
|
|
|
mutations << 'nil'
|
2013-01-01 17:28:21 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
it_should_behave_like 'a mutator'
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'super with arguments' do
|
|
|
|
let(:source) { 'super(foo, bar)' }
|
|
|
|
|
|
|
|
let(:mutations) do
|
|
|
|
mutations = []
|
|
|
|
mutations << 'super'
|
|
|
|
mutations << 'super()'
|
|
|
|
mutations << 'super(foo)'
|
|
|
|
mutations << 'super(bar)'
|
2013-09-08 02:10:25 -04:00
|
|
|
mutations << 'super(foo, nil)'
|
|
|
|
mutations << 'super(nil, bar)'
|
|
|
|
mutations << 'nil'
|
2013-01-01 17:28:21 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
it_should_behave_like 'a mutator'
|
|
|
|
end
|
|
|
|
end
|