1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/with_different_ofs.rb (DifferentOFS): should not affect

original classes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-12-26 02:15:55 +00:00
parent dd5ad24735
commit 6d8c13bc61
13 changed files with 25 additions and 22 deletions

View file

@ -1,18 +1,16 @@
module DifferentOFS
def setup
super
@ofs, $, = $,, "-"
end
def teardown
$, = @ofs
super
end
module WithDifferentOFS
def with_diffrent_ofs
def setup
super
@ofs, $, = $,, "-"
end
def teardown
$, = @ofs
super
end
end
def self.included(klass)
def self.extended(klass)
super(klass)
klass.const_set(:DifferentOFS, Class.new(klass).class_eval {include WithDifferentOFS}).name
end