Sha256: b850735077a70e0ae151ed0084217dcecb6f961aa1d8725052db28144a1078ae

Contents?: true

Size: 676 Bytes

Versions: 3

Compression:

Stored size: 676 Bytes

Contents

require 'spec_helper'

module Bogus
  describe MakesSubstituteMethods do
    class SampleForCopyingMethods
      def self.foo(name, value = "hello", *rest, &block)
        "this is the method body"
      end
    end

    let(:method_stringifier) { isolate(MethodStringifier) }
    let(:makes_substitute_methods) { isolate(MakesSubstituteMethods) }

    it "makes a copy of the method with its params and adds recording" do
      copy = makes_substitute_methods.stringify(SampleForCopyingMethods.method(:foo))

      copy.should == <<-EOF
      def foo(name, value = {}, *rest, &block)
        __record__(:foo, name, value, *rest, &block)
      end
      EOF
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bogus-0.0.3 spec/bogus/makes_substitute_methods_spec.rb
bogus-0.0.3.rc.2 spec/bogus/makes_substitute_methods_spec.rb
bogus-0.0.3.rc.1 spec/bogus/makes_substitute_methods_spec.rb