ref: refs/heads/master
commit ee3484fc6c4bee457312606756c344aad02f4205
Author: Duncan Mac-Vicar P
Date: Wed Aug 12 18:20:14 2009 +0200
Could not figure what does this do here and why it is breaking the
build.
The tests seems to have nothing to do with the code
---
.../test/functional/commands_controller_test.rb | 68 --------------------
.../test/functional/config_ntp_controller_test.rb | 55 ----------------
2 files changed, 0 insertions(+), 123 deletions(-)
diff --git a/plugins/services/test/functional/commands_controller_test.rb b/plugins/services/test/functional/commands_controller_test.rb
deleted file mode 100644
index 1a0a4a3..0000000
--- a/plugins/services/test/functional/commands_controller_test.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-require File.expand_path(File.dirname(__FILE__) + "/../test_helper")
-require 'test/unit'
-require 'rubygems'
-require "scr"
-require 'mocha'
-
-# Prevent contacting the system bus
-# This looks ugly but the stubs(:initialize) below causes a warning
-class Scr
- def initialize() end
-end
-
-class CommandsControllerTest < ActionController::TestCase
- fixtures :accounts
- def setup
- @controller = CommandsController.new
- @request = ActionController::TestRequest.new
- # http://railsforum.com/viewtopic.php?id=1719
- @request.session[:account_id] = 1 # defined in fixtures
-
-# Scr.stubs(:initialize)
- # Scr, unused?
- Scr.any_instance.stubs(:execute).with(["/sbin/yast2", "ntp-client", "list"]).returns({:stderr=>"Server ntp1\nServer ntp2\nServer ntp3\n", :exit=>16, :stdout=>""})
- Scr.any_instance.stubs(:execute).with(["/sbin/yast2", "ntp-client", "status"]).returns({:stderr=>"NTP daemon is enabled.\n", :exit=>16, :stdout=>""})
-
- # Lsbservice.new
- opened = mock()
- opened.stubs(:eof?).returns(false, true)
- opened.stubs(:read).returns("Usage: mock-ntp {tick|tock}")
- IO.stubs(:popen).with("/etc/init.d/ntp", 'r+').yields(opened)
- end
-
- test "access index" do
- get :index , :service_id=>"ntp"
- assert_response :redirect
- end
-
-# test "access index xml" do
-# mime = Mime::XML
-# @request.accept = mime.to_s
-# get :index, :format => :xml, :service_id=>"ntp"
-# assert_equal mime.to_s, @response.content_type
-# end
-
-# test "access index json" do
-# mime = Mime::JSON
-# @request.accept = mime.to_s
-# get :index, :format => :json, :service_id=>"ntp"
-# assert_equal mime.to_s, @response.content_type
-# end
-
- test "execute service" do
- Scr.any_instance.stubs(:execute).with(['/etc/init.d/ntp', 'status']).returns({:exit=>0, :stdout=>"", :stderr=>""})
-
- put :update, :id=>"status", :service_id=>"ntp"
- assert_response :success
- end
-
- test "execute service with nil return of the SCR call" do
- Scr.any_instance.stubs(:execute).with(['/etc/init.d/ntp', 'status']).returns()
-
- put :update, :id=>"status", :service_id=>"ntp"
- assert_response 404
- end
-
-
-
-end
diff --git a/plugins/services/test/functional/config_ntp_controller_test.rb b/plugins/services/test/functional/config_ntp_controller_test.rb
deleted file mode 100644
index cb015bf..0000000
--- a/plugins/services/test/functional/config_ntp_controller_test.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-require File.expand_path(File.dirname(__FILE__) + "/../test_helper")
-require 'test/unit'
-require 'rubygems'
-require "scr"
-require 'mocha'
-
-# Prevent contacting the system bus
-# This looks ugly but the stubs(:initialize) below causes a warning
-class Scr
- def initialize() end
-end
-
-class ConfigNtpControllerTest < ActionController::TestCase
- fixtures :accounts
- def setup
- @controller = ConfigNtpController.new
- @request = ActionController::TestRequest.new
- # http://railsforum.com/viewtopic.php?id=1719
- @request.session[:account_id] = 1 # defined in fixtures
-
-# Scr.stubs(:initialize)
- Scr.any_instance.stubs(:execute).with(["/sbin/yast2", "ntp-client", "list"]).returns({:stderr=>"Server ntp1\nServer ntp2\nServer ntp3\n", :exit=>16, :stdout=>""})
- Scr.any_instance.stubs(:execute).with(["/sbin/yast2", "ntp-client", "status"]).returns({:stderr=>"NTP daemon is enabled.\n", :exit=>16, :stdout=>""})
-
-
- end
-
- test "access show" do
- get :show
- assert_response :success
- end
-
- test "access show xml" do
- mime = Mime::XML
- @request.accept = mime.to_s
- get :show, :format => :xml
- assert_equal mime.to_s, @response.content_type
- end
-
- test "access show json" do
- mime = Mime::JSON
- @request.accept = mime.to_s
- get :show, :format => :json
- assert_equal mime.to_s, @response.content_type
- end
-
- test "access show with a SCR call which returns nil" do
- Scr.any_instance.stubs(:execute).with(["/sbin/yast2", "ntp-client", "list"]).returns()
- Scr.any_instance.stubs(:execute).with(["/sbin/yast2", "ntp-client", "status"]).returns()
- get :show
- assert_response :success
- end
-
-
-end
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org