[macruby-changes] [1126] MacRuby/branches/experimental/spec/frozen/language/not_spec.rb

source_changes at macosforge.org source_changes at macosforge.org
Tue Mar 24 02:59:03 PDT 2009


Revision: 1126
          http://trac.macosforge.org/projects/ruby/changeset/1126
Author:   eloy.de.enige at gmail.com
Date:     2009-03-24 02:59:03 -0700 (Tue, 24 Mar 2009)
Log Message:
-----------
Added a few specs for the "not" and the "!" keywords.

Modified Paths:
--------------
    MacRuby/branches/experimental/spec/frozen/language/not_spec.rb

Modified: MacRuby/branches/experimental/spec/frozen/language/not_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/language/not_spec.rb	2009-03-24 09:58:54 UTC (rev 1125)
+++ MacRuby/branches/experimental/spec/frozen/language/not_spec.rb	2009-03-24 09:59:03 UTC (rev 1126)
@@ -1 +1,25 @@
 require File.dirname(__FILE__) + '/../spec_helper'
+
+describe "The not keyword" do
+  it "negates a `true' value" do
+    (not true).should be_false
+    (not 'true').should be_false
+  end
+
+  it "negates a `false' value" do
+    (not false).should be_true
+    (not nil).should be_true
+  end
+end
+
+describe "The `!' keyword" do
+  it "negates a `true' value" do
+    (!true).should be_false
+    (!'true').should be_false
+  end
+
+  it "negates a `false' value" do
+    (!false).should be_true
+    (!nil).should be_true
+  end
+end
\ No newline at end of file
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090324/88475151/attachment.html>


More information about the macruby-changes mailing list