free_mutant/spec/unit/mutant/mutator/node/super_spec.rb

47 lines
889 B
Ruby
Raw Normal View History

# 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'
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)'
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