Skip to content

Commit

Permalink
test anonymous class method_missing behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
bivab committed Mar 19, 2013
1 parent 9bffa9d commit 704eac3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/objects/test_classobject.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import pytest
from ..base import BaseTopazTest

class TestClassObject(object):

class TestClassObject(BaseTopazTest):
def test_name(self, space):
space.execute("Class")

Expand All @@ -27,6 +29,13 @@ def test_anon_class_name(self, space):
w_res = space.execute("return Class.new.name")
assert w_res is space.w_nil

def test_anon_class_method_missing_raises(self, space):
with self.raises(space, "NoMethodError"):
space.execute("""
class A; end
Class.new.does_not_exist
""")

def test_singletonclass_name(self, space):
w_res = space.execute("Class.new.singleton_class.name")
assert w_res is space.w_nil
Expand Down

0 comments on commit 704eac3

Please sign in to comment.