Mailinglist Archive: yast-commit (883 mails)

< Previous Next >
[yast-commit] <rest-service> master : follow ruby conventions for constants
  • From: Josef Reidinger <jreidinger@xxxxxxx>
  • Date: Thu, 9 Jul 2009 12:05:03 +0200
  • Message-id: <E1MOqNt-0004ma-E2@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit 0df1fbc309f91289256987f49295e0d288d809aa
Author: Josef Reidinger <jreidinger@xxxxxxx>
Date: Thu Jul 9 12:05:03 2009 +0200

follow ruby conventions for constants
---
.../test/functional/language_controller_test.rb | 16 ++++++++--------
.../test/functional/systemtimes_controller_test.rb | 14 +++++++-------
webservice/test/plugin_basic_tests.rb | 8 ++++----
3 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/plugins/language/test/functional/language_controller_test.rb
b/plugins/language/test/functional/language_controller_test.rb
index 0ecec92..e17e724 100644
--- a/plugins/language/test/functional/language_controller_test.rb
+++ b/plugins/language/test/functional/language_controller_test.rb
@@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) +
"/../test_helper")
require 'test/unit'
require 'rubygems'
require 'mocha'
-require File.expand_path( File.join("lib","plugin_basic_tests"),
RailsParent.parent )
+require File.expand_path( File.join("test","plugin_basic_tests"),
RailsParent.parent )

class LanguageControllerTest < ActionController::TestCase
fixtures :accounts
@@ -13,12 +13,12 @@ class LanguageControllerTest < ActionController::TestCase
@request = ActionController::TestRequest.new
# http://railsforum.com/viewtopic.php?id=1719
@request.session[:account_id] = 1 # defined in fixtures
- @data = Data
+ @data = DATA
end

include PluginBasicTests

- Data = {:language => {
+ DATA = {:language => {
:current => "cs_CZ",
:utf8 => "true",
:rootlocale => "false"
@@ -26,13 +26,13 @@ class LanguageControllerTest < ActionController::TestCase

def test_update
Language.any_instance.stubs(:save)
- put :update, Data
+ put :update, DATA
check_update_result
end

def test_create
Language.any_instance.stubs(:save)
- put :create, Data
+ put :create, DATA
check_update_result
end

@@ -40,8 +40,8 @@ class LanguageControllerTest < ActionController::TestCase
assert_response :success
lang = assigns(:language)
assert lang
- assert_equal lang.language, Data[:language][:current]
- assert_equal lang.utf8, Data[:language][:utf8]
- assert_equal lang.rootlocale, Data[:language][:rootlocale]
+ assert_equal lang.language, DATA[:language][:current]
+ assert_equal lang.utf8, DATA[:language][:utf8]
+ assert_equal lang.rootlocale, DATA[:language][:rootlocale]
end
end
diff --git a/plugins/time/test/functional/systemtimes_controller_test.rb
b/plugins/time/test/functional/systemtimes_controller_test.rb
index 883bf04..8da320a 100644
--- a/plugins/time/test/functional/systemtimes_controller_test.rb
+++ b/plugins/time/test/functional/systemtimes_controller_test.rb
@@ -3,12 +3,12 @@ require 'test/unit'
require 'rubygems'
require "scr"
require 'mocha'
-require File.expand_path( File.join("lib","plugin_basic_tests"),
RailsParent.parent )
+require File.expand_path( File.join("test","plugin_basic_tests"),
RailsParent.parent )

class SystemtimesControllerTest < ActionController::TestCase
fixtures :accounts

- Data = {:time => {
+ DATA = {:time => {
:timezone => "Europe/Prague",
:utcstatus => "true"
}}
@@ -19,20 +19,20 @@ class SystemtimesControllerTest < ActionController::TestCase
@request = ActionController::TestRequest.new
# http://railsforum.com/viewtopic.php?id=1719
@request.session[:account_id] = 1 # defined in fixtures
- @data = Data
+ @data = DATA
end

include PluginBasicTests

def test_update
Systemtime.any_instance.stubs(:save)
- put :update, Data
+ put :update, DATA
check_update_result
end

def test_create
Systemtime.any_instance.stubs(:save)
- put :create, Data
+ put :create, DATA
check_update_result
end

@@ -40,8 +40,8 @@ class SystemtimesControllerTest < ActionController::TestCase
assert_response :success
time = assigns(:systemtime)
assert time
- assert_equal Data[:time][:timezone], time.timezone
- assert_equal Data[:time][:utcstatus], time.utcstatus
+ assert_equal DATA[:time][:timezone], time.timezone
+ assert_equal DATA[:time][:utcstatus], time.utcstatus
assert_nil time.datetime
end
end
\ No newline at end of file
diff --git a/webservice/test/plugin_basic_tests.rb
b/webservice/test/plugin_basic_tests.rb
index 1ac1760..d16dd34 100644
--- a/webservice/test/plugin_basic_tests.rb
+++ b/webservice/test/plugin_basic_tests.rb
@@ -17,12 +17,12 @@
# require 'test/unit'
# require 'rubygems'
# require 'mocha'
-# require File.expand_path( File.join("lib","plugin_basic_tests"),
RailsParent.parent )
+# require File.expand_path( File.join("test","plugin_basic_tests"),
RailsParent.parent )
#
# class LanguageControllerTest < ActionController::TestCase
# fixtures :accounts
#
-# Test_data = {:language => {
+# TEST_DATA = {:language => {
# :current => "cs_CZ",
# :utf8 => "true",
# :rootlocale => "false"
@@ -33,7 +33,7 @@
# @request = ActionController::TestRequest.new
# # http://railsforum.com/viewtopic.php?id=1719
# @request.session[:account_id] = 1 # defined in fixtures
-# @data = Test_data
+# @data = TEST_DATA
# end
#
# include PluginBasicTests
@@ -80,7 +80,7 @@ module PluginBasicTests
end

def test_update_noperm
- #ensure that nothink is saved
+ #ensure that nothing is saved
@model_class.any_instance.expects(:save).never

@controller.stubs(:permission_check).returns(false);
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages