[macruby-changes] [2035] MacRuby/branches/experimental/spec/frozen

source_changes at macosforge.org source_changes at macosforge.org
Mon Jul 20 13:28:18 PDT 2009


Revision: 2035
          http://trac.macosforge.org/projects/ruby/changeset/2035
Author:   pthomson at apple.com
Date:     2009-07-20 13:28:18 -0700 (Mon, 20 Jul 2009)
Log Message:
-----------
Re-enabled the system specs and tagged the failing ones.

Added Paths:
-----------
    MacRuby/branches/experimental/spec/frozen/core/kernel/system_spec.rb
    MacRuby/branches/experimental/spec/frozen/tags/macruby/core/kernel/system_tags.txt

Removed Paths:
-------------
    MacRuby/branches/experimental/spec/frozen/core/kernel/system_spec_disabled.rb

Copied: MacRuby/branches/experimental/spec/frozen/core/kernel/system_spec.rb (from rev 2034, MacRuby/branches/experimental/spec/frozen/core/kernel/system_spec_disabled.rb)
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/system_spec.rb	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/system_spec.rb	2009-07-20 20:28:18 UTC (rev 2035)
@@ -0,0 +1,74 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
+
+describe "Kernel#system" do
+
+  it "can run basic things that exist" do
+    begin
+      result = false
+
+      File.exist?("happy").should == false
+      result = system("echo a >> happy")
+      result.should == true
+      File.exist?("happy").should == true
+    ensure
+      File.unlink "happy"
+    end
+  end
+
+  ruby_version_is ""..."1.9" do
+    it "returns false when command execution fails" do
+      result = system("sad")
+      result.should == false
+    end
+  end
+
+  ruby_version_is "1.9" do
+    it "returns nil when command execution fails" do
+      result = system("sad")
+      result.should be_nil
+    end
+  end
+
+  it "returns false when the command has a non-zero exit status" do
+    result = system("#{RUBY_EXE} -e 'exit(1)'")
+    result.should be_false
+  end
+
+  it "does not write to stderr when it can't find a command" do
+    system("sad").should output_to_fd("") # nothing in stderr
+  end  
+
+  it "uses /bin/sh if freaky shit is in the command" do
+    begin
+      result = false
+
+      File.exist?("happy").should == false
+      result = system("echo woot > happy")
+      result.should == true
+      File.exist?("happy").should == true
+    ensure
+      File.unlink "happy"
+    end
+  end
+
+  it "is a private method" do
+    Kernel.should have_private_instance_method(:system)
+  end
+
+  before :each do
+    ENV['TEST_SH_EXPANSION'] = 'foo'
+    @shell_var = platform_is(:windows) ? '%TEST_SH_EXPANSION%' : '$TEST_SH_EXPANSION'
+    @helper_script = KernelSpecs.helper_script
+  end
+
+  it "expands shell variables when given a single string argument" do
+    result = system("ruby #{@helper_script} #{@shell_var} foo")
+    result.should be_true
+  end
+  
+  it "does not expand shell variables when given multiples arguments" do
+    result = system("ruby", @helper_script, @shell_var, "foo")
+    result.should be_false
+  end
+end

Deleted: MacRuby/branches/experimental/spec/frozen/core/kernel/system_spec_disabled.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/core/kernel/system_spec_disabled.rb	2009-07-20 20:19:56 UTC (rev 2034)
+++ MacRuby/branches/experimental/spec/frozen/core/kernel/system_spec_disabled.rb	2009-07-20 20:28:18 UTC (rev 2035)
@@ -1,74 +0,0 @@
-require File.dirname(__FILE__) + '/../../spec_helper'
-require File.dirname(__FILE__) + '/fixtures/classes'
-
-describe "Kernel#system" do
-
-  it "can run basic things that exist" do
-    begin
-      result = false
-
-      File.exist?("happy").should == false
-      result = system("echo a >> happy")
-      result.should == true
-      File.exist?("happy").should == true
-    ensure
-      File.unlink "happy"
-    end
-  end
-
-  ruby_version_is ""..."1.9" do
-    it "returns false when command execution fails" do
-      result = system("sad")
-      result.should == false
-    end
-  end
-
-  ruby_version_is "1.9" do
-    it "returns nil when command execution fails" do
-      result = system("sad")
-      result.should be_nil
-    end
-  end
-
-  it "returns false when the command has a non-zero exit status" do
-    result = system("#{RUBY_EXE} -e 'exit(1)'")
-    result.should be_false
-  end
-
-  it "does not write to stderr when it can't find a command" do
-    system("sad").should output_to_fd("") # nothing in stderr
-  end  
-
-  it "uses /bin/sh if freaky shit is in the command" do
-    begin
-      result = false
-
-      File.exist?("happy").should == false
-      result = system("echo woot > happy")
-      result.should == true
-      File.exist?("happy").should == true
-    ensure
-      File.unlink "happy"
-    end
-  end
-
-  it "is a private method" do
-    Kernel.should have_private_instance_method(:system)
-  end
-
-  before :each do
-    ENV['TEST_SH_EXPANSION'] = 'foo'
-    @shell_var = platform_is(:windows) ? '%TEST_SH_EXPANSION%' : '$TEST_SH_EXPANSION'
-    @helper_script = KernelSpecs.helper_script
-  end
-
-  it "expands shell variables when given a single string argument" do
-    result = system("ruby #{@helper_script} #{@shell_var} foo")
-    result.should be_true
-  end
-  
-  it "does not expand shell variables when given multiples arguments" do
-    result = system("ruby", @helper_script, @shell_var, "foo")
-    result.should be_false
-  end
-end

Added: MacRuby/branches/experimental/spec/frozen/tags/macruby/core/kernel/system_tags.txt
===================================================================
--- MacRuby/branches/experimental/spec/frozen/tags/macruby/core/kernel/system_tags.txt	                        (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/tags/macruby/core/kernel/system_tags.txt	2009-07-20 20:28:18 UTC (rev 2035)
@@ -0,0 +1,2 @@
+fails:Kernel#system does not write to stderr when it can't find a command
+fails:Kernel#system is a private method
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090720/a6b6d030/attachment-0001.html>


More information about the macruby-changes mailing list