2013-12-07 13:07:18 -05:00
|
|
|
# encoding: UTF-8
|
|
|
|
|
2013-10-30 04:06:39 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Mutant::Subject::Method::Instance do
|
|
|
|
include Mutant::NodeHelpers
|
|
|
|
|
|
|
|
let(:object) { described_class.new(context, node) }
|
|
|
|
let(:context) { double }
|
|
|
|
|
|
|
|
let(:node) do
|
|
|
|
s(:def, :foo, s(:args))
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '#source' do
|
|
|
|
subject { object.source }
|
|
|
|
|
|
|
|
it { should eql("def foo\nend") }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe Mutant::Subject::Method::Instance::Memoized do
|
|
|
|
include Mutant::NodeHelpers
|
|
|
|
|
|
|
|
let(:object) { described_class.new(context, node) }
|
|
|
|
let(:context) { double }
|
|
|
|
|
|
|
|
let(:node) do
|
|
|
|
s(:def, :foo, s(:args))
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '#source' do
|
|
|
|
subject { object.source }
|
|
|
|
|
|
|
|
it { should eql("def foo\nend\nmemoize(:foo)") }
|
|
|
|
end
|
|
|
|
end
|