OSDN Git Service

Replaced mongrel with thin
[redminele/redminele.git] / ruby / lib / ruby / gems / 1.8 / gems / thin-1.2.11-x86-mswin32 / spec / command_spec.rb
diff --git a/ruby/lib/ruby/gems/1.8/gems/thin-1.2.11-x86-mswin32/spec/command_spec.rb b/ruby/lib/ruby/gems/1.8/gems/thin-1.2.11-x86-mswin32/spec/command_spec.rb
new file mode 100644 (file)
index 0000000..751d11f
--- /dev/null
@@ -0,0 +1,25 @@
+require File.dirname(__FILE__) + '/spec_helper'
+
+describe Command do
+  before do
+    Command.script = 'thin'
+    @command = Command.new(:start, :port => 3000, :daemonize => true, :log => 'hi.log',
+                           :require => %w(rubygems thin), :no_epoll => true)
+  end
+  
+  it 'should shellify command' do
+    out = @command.shellify
+    out.should include('--port=3000', '--daemonize', '--log="hi.log"', 'thin start --')
+    out.should_not include('--pid')
+  end
+  
+  it 'should shellify Array argument to multiple parameters' do
+    out = @command.shellify
+    out.should include('--require="rubygems"', '--require="thin"')
+  end
+
+  it 'should convert _ to - in option name' do
+    out = @command.shellify
+    out.should include('--no-epoll')
+  end
+end
\ No newline at end of file