Sha256: e361dcc32d6701861ac143241e609ee20c1b35728b50f24e7eb68ae0c6d6c01a
Contents?: true
Size: 861 Bytes
Versions: 8
Compression:
Stored size: 861 Bytes
Contents
require "spec_helper" module Nyanko module Unit describe Extender do before do stub_const("ExampleClass", Class.new) end it "extends instance methods" do Extender.new.expand(:ExampleClass) do def test "test" end end ExampleClass.new.test.should == "test" end it "extends class methods" do Extender.new.expand(:ExampleClass) do class_methods do def test "test" end end end ExampleClass.test.should == "test" end it "extends instance methods with prefix" do Extender.new("__prefix_").expand(:ExampleClass) do def test "test" end end ExampleClass.new.__prefix_test.should == "test" end end end end
Version data entries
8 entries across 8 versions & 1 rubygems