Remove a const_defined? check
This commit is contained in:
parent
ae3e567daa
commit
4651b5214f
@ -87,11 +87,16 @@ class RequirementTests < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_infer_name_from_class
|
def test_infer_name_from_class
|
||||||
klass, const = self.class, :FooRequirement
|
const = :FooRequirement
|
||||||
|
klass = self.class
|
||||||
|
|
||||||
klass.const_set(const, Class.new(Requirement))
|
klass.const_set(const, Class.new(Requirement))
|
||||||
assert_equal "foo", klass.const_get(const).new.name
|
|
||||||
ensure
|
begin
|
||||||
klass.send(:remove_const, const) if klass.const_defined?(const)
|
assert_equal "foo", klass.const_get(const).new.name
|
||||||
|
ensure
|
||||||
|
klass.send(:remove_const, const)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_dsl_default_formula
|
def test_dsl_default_formula
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user