Sha256: 000acd8c2f92a5b2e9224adad0b87639a41ce4f01888d2ed903c0cba45d2f6db

Contents?: true

Size: 693 Bytes

Versions: 6

Compression:

Stored size: 693 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 = Bogus::DefaultValue, *rest, &block)
        __record__(:foo, name, value, *rest, &block)
      end
      EOF
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bogus-0.1.4 spec/bogus/fakes/makes_substitute_methods_spec.rb
bogus-0.1.3 spec/bogus/makes_substitute_methods_spec.rb
bogus-0.1.2 spec/bogus/makes_substitute_methods_spec.rb
bogus-0.1.1 spec/bogus/makes_substitute_methods_spec.rb
bogus-0.1.0 spec/bogus/makes_substitute_methods_spec.rb
bogus-0.0.4 spec/bogus/makes_substitute_methods_spec.rb