Hello community,

here is the log from the commit of package yast2-ruby-bindings for 
openSUSE:Factory checked in at 2014-02-04 21:51:29
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-ruby-bindings (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-ruby-bindings.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-ruby-bindings"

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-ruby-bindings/yast2-ruby-bindings.changes  
2014-01-14 16:36:11.000000000 +0100
+++ 
/work/SRC/openSUSE:Factory/.yast2-ruby-bindings.new/yast2-ruby-bindings.changes 
    2014-02-04 22:50:41.000000000 +0100
@@ -1,0 +2,19 @@
+Tue Feb  4 14:34:15 UTC 2014 - [email protected]
+
+- format spec file
+
+-------------------------------------------------------------------
+Mon Feb  3 14:15:39 UTC 2014 - [email protected]
+
+- added Y2Logger - Ruby Logger for writing logs using the Yast
+  format, can be used by external libraries for logging into y2log
+- 3.1.7
+
+-------------------------------------------------------------------
+Mon Feb  3 10:07:48 UTC 2014 - [email protected]
+
+- final fix for Ops.get and Ops.set warnings to not point inside
+  their own implementation
+- 3.1.6
+
+-------------------------------------------------------------------

Old:
----
  yast2-ruby-bindings-3.1.5.tar.bz2

New:
----
  yast2-ruby-bindings-3.1.7.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-ruby-bindings.spec ++++++
--- /var/tmp/diff_new_pack.XrNNhq/_old  2014-02-04 22:50:42.000000000 +0100
+++ /var/tmp/diff_new_pack.XrNNhq/_new  2014-02-04 22:50:42.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-ruby-bindings
-Version:        3.1.5
+Version:        3.1.7
 Release:        0
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Source0:        yast2-ruby-bindings-%{version}.tar.bz2
@@ -30,6 +30,7 @@
 # libzypp-devel is missing .la requires
 BuildRequires:  ruby-devel
 BuildRequires:  rubygem-fast_gettext
+BuildRequires:  rubygem-rspec
 Requires:       rubygem-fast_gettext
 Requires:       yast2-core >= 2.24.0
 BuildRequires:  yast2-core-devel >= 2.24.0

++++++ yast2-ruby-bindings-3.1.5.tar.bz2 -> yast2-ruby-bindings-3.1.7.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-ruby-bindings-3.1.5/package/yast2-ruby-bindings.changes 
new/yast2-ruby-bindings-3.1.7/package/yast2-ruby-bindings.changes
--- old/yast2-ruby-bindings-3.1.5/package/yast2-ruby-bindings.changes   
2014-01-13 11:00:45.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.7/package/yast2-ruby-bindings.changes   
2014-02-04 15:35:54.000000000 +0100
@@ -1,4 +1,23 @@
 -------------------------------------------------------------------
+Tue Feb  4 14:34:15 UTC 2014 - [email protected]
+
+- format spec file
+
+-------------------------------------------------------------------
+Mon Feb  3 14:15:39 UTC 2014 - [email protected]
+
+- added Y2Logger - Ruby Logger for writing logs using the Yast
+  format, can be used by external libraries for logging into y2log
+- 3.1.7
+
+-------------------------------------------------------------------
+Mon Feb  3 10:07:48 UTC 2014 - [email protected]
+
+- final fix for Ops.get and Ops.set warnings to not point inside
+  their own implementation
+- 3.1.6
+
+-------------------------------------------------------------------
 Mon Jan 13 09:52:21 UTC 2014 - [email protected]
 
 - Prefer yast lib directory in LOAD_PATH to reduce collisions with
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-ruby-bindings-3.1.5/package/yast2-ruby-bindings.spec 
new/yast2-ruby-bindings-3.1.7/package/yast2-ruby-bindings.spec
--- old/yast2-ruby-bindings-3.1.5/package/yast2-ruby-bindings.spec      
2014-01-13 11:00:45.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.7/package/yast2-ruby-bindings.spec      
2014-02-04 15:35:54.000000000 +0100
@@ -1,28 +1,45 @@
 #
 # spec file for package yast2-ruby-bindings
 #
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
+#
+# All modifications and additions to the file contributed by third parties
+# remain the property of their copyright owners, unless otherwise agreed
+# upon. The license for this file, and modifications and additions to the
+# file, is the same license as for the pristine package itself (unless the
+# license for the pristine package is not an Open Source License, in which
+# case the license is the MIT License). An "Open Source License" is a
+# license that conforms to the Open Source Definition (Version 1.9)
+# published by the Open Source Initiative.
+
+# Please submit bugfixes or comments via http://bugs.opensuse.org/
+#
+
 
 Name:           yast2-ruby-bindings
-Version:        3.1.5
+Version:        3.1.7
 Release:        0
-License:        GPL-2.0
-Group:          System/YaST
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Source0:        yast2-ruby-bindings-%{version}.tar.bz2
 Prefix:         /usr
 
-BuildRequires: cmake gcc-c++ yast2-core-devel
+BuildRequires:  cmake
+BuildRequires:  gcc-c++
+BuildRequires:  yast2-core-devel
 BuildRequires:  yast2-devtools >= 3.1.10
 # libzypp-devel is missing .la requires
-BuildRequires: ruby-devel
-BuildRequires: rubygem-fast_gettext
-Requires:      rubygem-fast_gettext
-Requires:      yast2-core >= 2.24.0
+BuildRequires:  ruby-devel
+BuildRequires:  rubygem-fast_gettext
+BuildRequires:  rubygem-rspec
+Requires:       rubygem-fast_gettext
+Requires:       yast2-core >= 2.24.0
 BuildRequires:  yast2-core-devel >= 2.24.0
 Requires:       yast2-ycp-ui-bindings       >= 2.21.9
 BuildRequires:  yast2-ycp-ui-bindings-devel >= 2.21.9
-Requires:      ruby
-Summary:       Ruby bindings for the YaST platform
+Requires:       ruby
+Summary:        Ruby bindings for the YaST platform
+License:        GPL-2.0
+Group:          System/YaST
 
 %description
 The bindings allow YaST modules to be written using the Ruby language
@@ -59,3 +76,5 @@
 %{_libdir}/ruby/vendor_ruby/%{rb_ver}/yast
 %{_libdir}/ruby/vendor_ruby/%{rb_ver}/%{rb_arch}/*x.so
 %{_libdir}/ruby/vendor_ruby/%{rb_ver}/%{rb_arch}/yast
+
+%changelog
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.5/src/ruby/yast/ops.rb 
new/yast2-ruby-bindings-3.1.7/src/ruby/yast/ops.rb
--- old/yast2-ruby-bindings-3.1.5/src/ruby/yast/ops.rb  2014-01-13 
11:00:45.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.7/src/ruby/yast/ops.rb  2014-02-04 
15:35:54.000000000 +0100
@@ -52,6 +52,15 @@
 END
     end
 
+    # to log outer frame we need to skip 3 frames as 1 is method itself and
+    # 2 frames generate each block. Try your self:
+    #   def a
+    #     puts caller.inspect
+    #     [0].each { |i| puts caller.inspect }
+    #   end
+    #   a
+    OUTER_LOOP_FRAME = 3
+
     # gets value from object at indexes. In case that value is not found, then 
return default value.
     # @deprecated use ruby native operator []
     def self.get (object, indexes, default=nil)
@@ -66,11 +75,11 @@
             if (0..res.size-1).include? i
               res = res[i]
             else
-              Yast.y2milestone 2, "Index #{i} is out of array size"
+              Yast.y2milestone OUTER_LOOP_FRAME, "Index #{i} is out of array 
size"
               return block_given? ? yield : default
             end
           else
-            Yast.y2warning 2, "Passed #{i.inspect} as index key for array."
+            Yast.y2warning OUTER_LOOP_FRAME, "Passed #{i.inspect} as index key 
for array."
             return block_given? ? yield : default
           end
         when ::Hash
@@ -80,10 +89,10 @@
             return block_given? ? yield : default
           end
         when ::NilClass
-          Yast.y2milestone 2, "Builtin index called on nil."
+          Yast.y2milestone OUTER_LOOP_FRAME, "Builtin index called on nil."
           return block_given? ? yield : default
         else
-          Yast.y2warning 2, "Builtin index called on wrong type #{res.class}"
+          Yast.y2warning OUTER_LOOP_FRAME, "Builtin index called on wrong type 
#{res.class}"
           return block_given? ? yield : default
         end
       end
@@ -106,11 +115,11 @@
             if (0..res.size-1).include? i
               res = res[i]
             else
-              Yast.y2warning 2, "Index #{i} is out of array size"
+              Yast.y2warning OUTER_LOOP_FRAME, "Index #{i} is out of array 
size"
               return
             end
           else
-            Yast.y2warning 2, "Passed #{i.inspect} as index key for array."
+            Yast.y2warning OUTER_LOOP_FRAME, "Passed #{i.inspect} as index key 
for array."
             return
           end
         when ::Hash
@@ -120,7 +129,7 @@
             return
           end
         else
-          Yast.y2warning 2, "Builtin assign called on wrong type #{res.class}"
+          Yast.y2warning OUTER_LOOP_FRAME, "Builtin assign called on wrong 
type #{res.class}"
           return
         end
       end
@@ -128,6 +137,7 @@
       when ::Array, Yast::Term, ::Hash
         res[last] = Yast.deep_copy(value)
       else
+        # log is not in loop, so use simple 1 to get outside of method
         Yast.y2warning 1, "Builtin assign called on wrong type #{res.class}"
       end
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.5/src/ruby/yast/y2logger.rb 
new/yast2-ruby-bindings-3.1.7/src/ruby/yast/y2logger.rb
--- old/yast2-ruby-bindings-3.1.5/src/ruby/yast/y2logger.rb     1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.7/src/ruby/yast/y2logger.rb     2014-02-04 
15:35:54.000000000 +0100
@@ -0,0 +1,68 @@
+# encoding: utf-8
+
+require "logger"
+require "singleton"
+
+require "yast/logger"
+
+module Yast
+
+  # A Ruby Logger which wraps Yast.y2*() calls
+  class Y2Logger < ::Logger
+    include Singleton
+
+    # location of the caller
+    CALL_FRAME = 2
+
+    def add(severity, progname = nil, message = nil, &block)
+      message = yield if block_given?
+
+      case severity
+      when DEBUG
+        Yast.y2debug(CALL_FRAME, message)
+      when INFO
+        Yast.y2milestone(CALL_FRAME, message)
+      when WARN
+        Yast.y2warning(CALL_FRAME, message)
+      when ERROR
+        Yast.y2error(CALL_FRAME, message)
+      when FATAL
+        Yast.y2error(CALL_FRAME, message)
+      when UNKNOWN
+        Yast.y2internal(CALL_FRAME, message)
+      else
+        Yast.y2internal(CALL_FRAME, "Unknown error level #{severity}: Error: 
#{message}")
+      end
+    end
+
+    def initialize(*args)
+      # do not write to any file, the actual logging is implemented in add()
+      super(nil)
+      # process also debug messages but might not be logged in the end
+      self.level = ::Logger::DEBUG
+    end
+  end
+
+  # This module provides access to Yast specific logging
+  #
+  # @example Use YastLogger in an easy way
+  #   class Foo
+  #     include Yast::Logger
+  #
+  #     def foo
+  #       # this will be logged into y2log using the usual y2log format
+  #       log.debug "debug"
+  #       log.error "error"
+  #     end
+  #   end
+  module Logger
+    def log
+      Y2Logger.instance
+    end
+
+    def self.included(base)
+      base.extend self
+    end
+  end
+
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.5/src/ruby/yast.rb 
new/yast2-ruby-bindings-3.1.7/src/ruby/yast.rb
--- old/yast2-ruby-bindings-3.1.5/src/ruby/yast.rb      2014-01-13 
11:00:45.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.7/src/ruby/yast.rb      2014-02-04 
15:35:54.000000000 +0100
@@ -35,6 +35,7 @@
 require "yast/fun_ref"
 require "yast/i18n"
 require "yast/logger"
+require "yast/y2logger"
 require "yast/module"
 require "yast/ops"
 require "yast/path"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.5/tests/ruby/CMakeLists.txt 
new/yast2-ruby-bindings-3.1.7/tests/ruby/CMakeLists.txt
--- old/yast2-ruby-bindings-3.1.5/tests/ruby/CMakeLists.txt     2014-01-13 
11:00:45.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.7/tests/ruby/CMakeLists.txt     2014-02-04 
15:35:54.000000000 +0100
@@ -9,3 +9,10 @@
 foreach(test ${Tests})
     ADD_TEST(${test}   ruby -C ${CMAKE_CURRENT_SOURCE_DIR} ${test})
 endforeach(test)
+
+
+FILE(GLOB Specs "*_spec.rb")
+
+foreach(test ${Specs})
+    ADD_TEST(${test}   rspec ${test})
+endforeach(test)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-ruby-bindings-3.1.5/tests/ruby/builtins_test.rb 
new/yast2-ruby-bindings-3.1.7/tests/ruby/builtins_test.rb
--- old/yast2-ruby-bindings-3.1.5/tests/ruby/builtins_test.rb   2014-01-13 
11:00:45.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.7/tests/ruby/builtins_test.rb   2014-02-04 
15:35:54.000000000 +0100
@@ -1,7 +1,6 @@
 # encoding: utf-8
 
-$LOAD_PATH << File.dirname(__FILE__)
-require "test_helper"
+require_relative "test_helper_test_unit"
 
 require "yast/builtins"
 require "yast/path"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.5/tests/ruby/convert_test.rb 
new/yast2-ruby-bindings-3.1.7/tests/ruby/convert_test.rb
--- old/yast2-ruby-bindings-3.1.5/tests/ruby/convert_test.rb    2014-01-13 
11:00:45.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.7/tests/ruby/convert_test.rb    2014-02-04 
15:35:54.000000000 +0100
@@ -1,7 +1,6 @@
 # encoding: utf-8
 
-$LOAD_PATH << File.dirname(__FILE__)
-require "test_helper"
+require_relative "test_helper_test_unit"
 
 require "yast/convert"
 require "yast/path"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-ruby-bindings-3.1.5/tests/ruby/exportable_test.rb 
new/yast2-ruby-bindings-3.1.7/tests/ruby/exportable_test.rb
--- old/yast2-ruby-bindings-3.1.5/tests/ruby/exportable_test.rb 2014-01-13 
11:00:45.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.7/tests/ruby/exportable_test.rb 2014-02-04 
15:35:54.000000000 +0100
@@ -1,5 +1,4 @@
-$LOAD_PATH << File.dirname(__FILE__)
-require "test_helper"
+require_relative "test_helper_test_unit"
 
 require 'yast/exportable'
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.5/tests/ruby/import_test.rb 
new/yast2-ruby-bindings-3.1.7/tests/ruby/import_test.rb
--- old/yast2-ruby-bindings-3.1.5/tests/ruby/import_test.rb     2014-01-13 
11:00:45.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.7/tests/ruby/import_test.rb     2014-02-04 
15:35:54.000000000 +0100
@@ -2,8 +2,7 @@
 # Test Ycp.import
 #
 
-$LOAD_PATH << File.dirname(__FILE__)
-require "test_helper"
+require_relative "test_helper_test_unit"
 
 require "yast"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.5/tests/ruby/include_test.rb 
new/yast2-ruby-bindings-3.1.7/tests/ruby/include_test.rb
--- old/yast2-ruby-bindings-3.1.5/tests/ruby/include_test.rb    2014-01-13 
11:00:45.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.7/tests/ruby/include_test.rb    2014-02-04 
15:35:54.000000000 +0100
@@ -2,8 +2,7 @@
 # Test Ycp.import
 #
 
-$LOAD_PATH << File.dirname(__FILE__)
-require "test_helper"
+require_relative "test_helper_test_unit"
 
 require "yast"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.5/tests/ruby/ops_test.rb 
new/yast2-ruby-bindings-3.1.7/tests/ruby/ops_test.rb
--- old/yast2-ruby-bindings-3.1.5/tests/ruby/ops_test.rb        2014-01-13 
11:00:45.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.7/tests/ruby/ops_test.rb        2014-02-04 
15:35:54.000000000 +0100
@@ -1,7 +1,6 @@
 # encoding: utf-8
 
-$LOAD_PATH << File.dirname(__FILE__)
-require "test_helper"
+require_relative "test_helper_test_unit"
 
 require "yast/ops"
 require "yast/convert"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.5/tests/ruby/path_test.rb 
new/yast2-ruby-bindings-3.1.7/tests/ruby/path_test.rb
--- old/yast2-ruby-bindings-3.1.5/tests/ruby/path_test.rb       2014-01-13 
11:00:45.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.7/tests/ruby/path_test.rb       2014-02-04 
15:35:54.000000000 +0100
@@ -1,5 +1,4 @@
-$LOAD_PATH << File.dirname(__FILE__)
-require "test_helper"
+require_relative "test_helper_test_unit"
 
 require "yast/path"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.5/tests/ruby/term_test.rb 
new/yast2-ruby-bindings-3.1.7/tests/ruby/term_test.rb
--- old/yast2-ruby-bindings-3.1.5/tests/ruby/term_test.rb       2014-01-13 
11:00:45.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.7/tests/ruby/term_test.rb       2014-02-04 
15:35:54.000000000 +0100
@@ -1,5 +1,4 @@
-$LOAD_PATH << File.dirname(__FILE__)
-require "test_helper"
+require_relative "test_helper_test_unit"
 
 require "yast/term"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.5/tests/ruby/test_helper.rb 
new/yast2-ruby-bindings-3.1.7/tests/ruby/test_helper.rb
--- old/yast2-ruby-bindings-3.1.5/tests/ruby/test_helper.rb     2014-01-13 
11:00:45.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.7/tests/ruby/test_helper.rb     2014-02-04 
15:35:54.000000000 +0100
@@ -8,8 +8,3 @@
 $:.unshift "#{ROOT_DIR}/src/ruby"       # yast.rb
 ENV["Y2DIR"] = File.dirname(__FILE__)
 
-require 'test/unit'
-
-module Yast
-  TestCase = Test::Unit::TestCase
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-ruby-bindings-3.1.5/tests/ruby/test_helper_rspec.rb 
new/yast2-ruby-bindings-3.1.7/tests/ruby/test_helper_rspec.rb
--- old/yast2-ruby-bindings-3.1.5/tests/ruby/test_helper_rspec.rb       
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.7/tests/ruby/test_helper_rspec.rb       
2014-02-04 15:35:54.000000000 +0100
@@ -0,0 +1,2 @@
+require_relative "test_helper"
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-ruby-bindings-3.1.5/tests/ruby/test_helper_test_unit.rb 
new/yast2-ruby-bindings-3.1.7/tests/ruby/test_helper_test_unit.rb
--- old/yast2-ruby-bindings-3.1.5/tests/ruby/test_helper_test_unit.rb   
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.7/tests/ruby/test_helper_test_unit.rb   
2014-02-04 15:35:54.000000000 +0100
@@ -0,0 +1,7 @@
+require_relative "test_helper"
+
+require "test/unit"
+
+module Yast
+  TestCase = Test::Unit::TestCase
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-ruby-bindings-3.1.5/tests/ruby/ui_shortcuts_test.rb 
new/yast2-ruby-bindings-3.1.7/tests/ruby/ui_shortcuts_test.rb
--- old/yast2-ruby-bindings-3.1.5/tests/ruby/ui_shortcuts_test.rb       
2014-01-13 11:00:45.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.7/tests/ruby/ui_shortcuts_test.rb       
2014-02-04 15:35:54.000000000 +0100
@@ -1,5 +1,4 @@
-$LOAD_PATH << File.dirname(__FILE__)
-require "test_helper"
+require_relative "test_helper_test_unit"
 
 require "yast/ui_shortcuts"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-ruby-bindings-3.1.5/tests/ruby/y2logger_spec.rb 
new/yast2-ruby-bindings-3.1.7/tests/ruby/y2logger_spec.rb
--- old/yast2-ruby-bindings-3.1.5/tests/ruby/y2logger_spec.rb   1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.7/tests/ruby/y2logger_spec.rb   2014-02-04 
15:35:54.000000000 +0100
@@ -0,0 +1,57 @@
+#!/usr/bin/env rspec
+
+require_relative "test_helper_rspec"
+
+require "yast/y2logger"
+
+module Yast
+  describe Y2Logger do
+
+    TEST_MESSAGE = "Testing"
+
+    before do
+      @test_logger = Y2Logger.instance
+    end
+
+    it "logs debug messages via y2debug()" do
+      Yast.should_receive(:y2debug).with(Y2Logger::CALL_FRAME, TEST_MESSAGE)
+      @test_logger.debug TEST_MESSAGE
+    end
+
+    it "logs info messages via y2milestone()" do
+      Yast.should_receive(:y2milestone).with(Y2Logger::CALL_FRAME, 
TEST_MESSAGE)
+      @test_logger.info TEST_MESSAGE
+    end
+
+    it "logs warnings via y2warning()" do
+      Yast.should_receive(:y2warning).with(Y2Logger::CALL_FRAME, TEST_MESSAGE)
+      @test_logger.warn TEST_MESSAGE
+    end
+
+    it "logs errors via y2error()" do
+      Yast.should_receive(:y2error).with(Y2Logger::CALL_FRAME, TEST_MESSAGE)
+      @test_logger.error TEST_MESSAGE
+    end
+
+    it "logs fatal errors via y2error()" do
+      Yast.should_receive(:y2error).with(Y2Logger::CALL_FRAME, TEST_MESSAGE)
+      @test_logger.fatal TEST_MESSAGE
+    end
+
+    it "handles a message passed via block" do
+      Yast.should_receive(:y2milestone).with(Y2Logger::CALL_FRAME, 
TEST_MESSAGE)
+      @test_logger.info { TEST_MESSAGE }
+    end
+  end
+
+  describe Yast::Logger do
+    it "module adds log() method for accessing the Logger" do
+      class Test
+        include Yast::Logger
+      end
+      expect(Test.log).to be_kind_of(::Logger)
+      expect(Test.new.log).to be_kind_of(::Logger)
+    end
+  end
+
+end

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to