aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/pathname_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/core_ext/pathname_test.rb')
-rw-r--r--activesupport/test/core_ext/pathname_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/pathname_test.rb b/activesupport/test/core_ext/pathname_test.rb
new file mode 100644
index 0000000000..3f49b665b2
--- /dev/null
+++ b/activesupport/test/core_ext/pathname_test.rb
@@ -0,0 +1,12 @@
+require 'test/unit'
+require File.dirname(__FILE__) + '/../../lib/active_support/core_ext/pathname'
+
+class TestPathname < Test::Unit::TestCase
+
+ def test_clean_within
+ assert_equal "Hi", Pathname.clean_within("Hi")
+ assert_equal "Hi", Pathname.clean_within("Hi/a/b/../..")
+ assert_equal "Hello\nWorld", Pathname.clean_within("Hello/a/b/../..\na/b/../../World/c/..")
+ end
+
+end