diff options
author | Xavier Noria <fxn@hashref.com> | 2010-02-11 23:15:04 +0100 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-02-11 23:15:04 +0100 |
commit | b8bb54af7ff6652327d99f6a7cf5c96a3f3f876d (patch) | |
tree | ad12a39f6056b0fee2f2803dfb6b14c5e56eb42d /activesupport/test/core_ext/module | |
parent | eea28b07cf25d5c79f8edeb8bef5e0483b489425 (diff) | |
download | rails-b8bb54af7ff6652327d99f6a7cf5c96a3f3f876d.tar.gz rails-b8bb54af7ff6652327d99f6a7cf5c96a3f3f876d.tar.bz2 rails-b8bb54af7ff6652327d99f6a7cf5c96a3f3f876d.zip |
defines Module#anonymous?
Diffstat (limited to 'activesupport/test/core_ext/module')
-rw-r--r-- | activesupport/test/core_ext/module/anonymous_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/module/anonymous_test.rb b/activesupport/test/core_ext/module/anonymous_test.rb new file mode 100644 index 0000000000..7a78a3b012 --- /dev/null +++ b/activesupport/test/core_ext/module/anonymous_test.rb @@ -0,0 +1,14 @@ +require 'abstract_unit' +require 'active_support/core_ext/module/anonymous' + +class AnonymousTest < ActiveSupport::TestCase + test "an anonymous class or module are anonymous" do + assert Module.new.anonymous? + assert Class.new.anonymous? + end + + test "a named class or module are not anonymous" do + assert !Kernel.anonymous? + assert !Object.anonymous? + end +end
\ No newline at end of file |