-
-
Notifications
You must be signed in to change notification settings - Fork 160
Closed
Description
I would like to mock a class constant but it does not work:
require 'test/unit'
require 'mocha'
class A
MY_CONST = 'a'
end
class MyTest < Test::Unit::TestCase
def test_should_returns_b
assert_equal( 'a', A::MY_CONST )
A.stubs( :MY_CONST ).returns( 'b' )
assert_equal( 'b', A::MY_CONST )
end
end
Is there any way to do something like this?
Thanks.
f.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels