Browse files

add more namespace tests and improve wording

  • Loading branch information...
1 parent d74a4e2 commit 0f5a56194aa4e1d3e17e05b5b885d851af996e43 Alex Suraci committed Aug 1, 2011
Showing with 23 additions and 2 deletions.
  1. +23 −2 test/suite/namespaces.ay
View
25 test/suite/namespaces.ay
@@ -1,18 +1,39 @@
describe("namespaces"):
- it("doesn't provide methods to static scopes that don't use it"):
+ it("doesn't provide methods to static scopes that aren't `using' the module"):
namespace(NotUsed):
not-used := 1
{ not-used } should-raise(Atomy::MethodFail)
- it("lets scopes use methods after `using' the module"):
+ it("provides methods for static scopes that are `using' the module"):
namespace(Used):
used := 1
module(User):
using(Used)
used should-be(1)
+ it("persists used namespaces in a reopened module"):
+ module(User):
+ used should-be(1)
+
+ it("allows using namespaces in a class definition"):
+ class(ClassUser):
+ using(Used)
+ used should-be(1)
+
+ it("persists used namespaces in a reopened class"):
+ class(ClassUser):
+ used should-be(1)
+
+ it("persists used namespaces through to a subclass"):
+ class(ClassUserSub < ClassUser):
+ used should-be(1)
+
+ it("does not persist through #module-eval"):
+ User module-eval:
+ { used } should-raise(Atomy::MethodFail)
+
it("allows providing recursive methods"):
namespace(Recursive):
0 recursive := 0

0 comments on commit 0f5a561

Please sign in to comment.