Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
drunken-octo-hipster/test/overwrite_test.rb
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
29 lines (22 sloc)
588 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest/autorun' | |
require 'configuration.rb' | |
describe Configuration do | |
before do | |
# similar to config/sample d.rb | |
Configuration.for('d'){ | |
built_in_object_id Send('object_id') | |
object_id 42 | |
built_in_inspect Send('inspect') | |
inspect 'forty-two' | |
p 42.0 | |
} | |
@c = Configuration.for 'd' | |
end | |
it "must overwrite built-in methods" do | |
@c.object_id.must_equal 42 | |
@c.object_id.wont_equal @c.built_in_object_id | |
@c.inspect.must_equal 'forty-two' | |
@c.inspect.wont_equal @c.built_in_inspect | |
@c.p.must_equal 42.0 | |
end | |
end |