From 8afa725f4b98a6e0ceee4792e8ebaebb6189e5f6 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 3 Jun 2008 17:44:56 -0500 Subject: Wrapped Rails.env in StringQuestioneer so you can do Rails.env.development? [DHH] --- activesupport/test/string_questioneer_test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 activesupport/test/string_questioneer_test.rb (limited to 'activesupport/test/string_questioneer_test.rb') 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 -- cgit v1.2.3