aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2008-06-03 17:44:56 -0500
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-06-03 17:44:56 -0500
commit8afa725f4b98a6e0ceee4792e8ebaebb6189e5f6 (patch)
tree358f418791a56620c32a48776739b4fdf39d3cb0 /activesupport/test
parent7cfa6ec8a37b70ec302f09929df5160ac42971e7 (diff)
downloadrails-8afa725f4b98a6e0ceee4792e8ebaebb6189e5f6.tar.gz
rails-8afa725f4b98a6e0ceee4792e8ebaebb6189e5f6.tar.bz2
rails-8afa725f4b98a6e0ceee4792e8ebaebb6189e5f6.zip
Wrapped Rails.env in StringQuestioneer so you can do Rails.env.development? [DHH]
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/string_questioneer_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/activesupport/test/string_questioneer_test.rb b/activesupport/test/string_questioneer_test.rb
new file mode 100644
index 0000000000..ff9d2c17f9
--- /dev/null
+++ b/activesupport/test/string_questioneer_test.rb
@@ -0,0 +1,15 @@
+require 'abstract_unit'
+
+class StringQuestioneerTest < Test::Unit::TestCase
+ def test_match
+ assert StringQuestioneer.new("production").production?
+ end
+
+ def test_miss
+ assert !StringQuestioneer.new("production").development?
+ end
+
+ def test_missing_question_mark
+ assert_raises(NoMethodError) { StringQuestioneer.new("production").production }
+ end
+end \ No newline at end of file