Skip to content

Commit

Permalink
added delegate module tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HoneyryderChuck committed Aug 25, 2021
1 parent ef41081 commit 96dbb69
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/stdlib/Delegate_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
require_relative "test_helper"
require "delegate"

class SimpleDelegatorInstanceTest < Test::Unit::TestCase
include TypeAssertions

library "delegate"
testing "::SimpleDelegator[::String]"

def test_get_obj
assert_send_type "() -> String",
string_delegator, :__getobj__
end

def test_delegate_method
assert_send_type "(String) -> String",
string_delegator, :<<, " world"
end

private

def string_delegator
Class.new(SimpleDelegator) do
def initialize
super("world")
end
end.new
end
end

0 comments on commit 96dbb69

Please sign in to comment.