changeset 3131:be6d214b6eff

Tidied up unit tests
author unexist
date Tue, 15 Nov 2011 21:43:06 +0100
parents 2715c8150dd8
children 94a2d064ffa6
files test/contexts/color.rb test/contexts/gravity.rb test/contexts/icon.rb test/contexts/sublet.rb test/contexts/subtle_init.rb test/contexts/tag.rb test/contexts/view.rb test/test.rb
diffstat 8 files changed, 17 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/test/contexts/color.rb	Tue Nov 15 21:42:50 2011 +0100
+++ b/test/contexts/color.rb	Tue Nov 15 21:43:06 2011 +0100
@@ -15,8 +15,8 @@
   end # }}}
 
   asserts 'Init types' do # {{{
-    c1 = Subtlext::Color.new topic
-    c2 = Subtlext::Color.new [ 255, 0, 0 ]
+    c1 = Subtlext::Color.new(topic)
+    c2 = Subtlext::Color.new([ 255, 0, 0 ])
     c3 = Subtlext::Color.new({ red: 255, green: 0, blue: 0 })
 
     topic == c1 and c1 == c2 and c1 == c3
@@ -35,11 +35,11 @@
   end # }}}
 
   asserts 'Equal and compare' do # {{{
-    topic.eql? Subtlext::Color.new('#ff0000') and topic == topic
+    topic.eql?(Subtlext::Color.new('#ff0000')) and topic == topic
   end # }}}
 
   asserts 'Convert to string' do # {{{
-    topic.to_str.match /<>#[0-9]+<>/
+    topic.to_str.match(/<>#[0-9]+<>/)
   end # }}}
 end
 
--- a/test/contexts/gravity.rb	Tue Nov 15 21:42:50 2011 +0100
+++ b/test/contexts/gravity.rb	Tue Nov 15 21:43:06 2011 +0100
@@ -38,7 +38,7 @@
     none   = Subtlext::Gravity['abcdef']
 
     index == string and index == sym and
-      all.is_a? Array and GRAVITY_COUNT == all.size and
+      all.is_a?(Array) and GRAVITY_COUNT == all.size and
       none.nil?
   end # }}}
 
@@ -50,13 +50,13 @@
   end # }}}
 
   asserts 'Equal and compare' do # {{{
-    topic.eql? Subtlext::Gravity.first(GRAVITY_ID) and topic == topic
+    topic.eql?(Subtlext::Gravity.first(GRAVITY_ID)) and topic == topic
   end # }}}
 
   asserts 'Check associations' do # {{{
     clients = topic.clients
 
-    clients.is_a? Array and 1 == clients.size
+    clients.is_a?(Array) and 1 == clients.size
   end # }}}
 
   asserts 'Convert to string' do # {{{
--- a/test/contexts/icon.rb	Tue Nov 15 21:42:50 2011 +0100
+++ b/test/contexts/icon.rb	Tue Nov 15 21:43:06 2011 +0100
@@ -15,7 +15,7 @@
   end # }}}
 
   asserts("Equal and compare") do # {{{
-    topic.eql? Subtlext::Icon.new(8, 8) and topic == topic
+    topic.eql?(Subtlext::Icon.new(8, 8)) and topic == topic
   end # }}}
 
   asserts("Check attributes") do # {{{
--- a/test/contexts/sublet.rb	Tue Nov 15 21:42:50 2011 +0100
+++ b/test/contexts/sublet.rb	Tue Nov 15 21:43:06 2011 +0100
@@ -51,11 +51,11 @@
   end # }}}
 
   asserts 'Get geometry' do # {{{
-    topic.geometry.is_a? Subtlext::Geometry
+    topic.geometry.is_a?(Subtlext::Geometry)
   end # }}}
 
   asserts 'Equal and compare' do # {{{
-    topic.eql? topic and topic == topic
+    topic.eql?(topic) and topic == topic
   end # }}}
 
   asserts 'Convert to string' do # {{{
--- a/test/contexts/subtle_init.rb	Tue Nov 15 21:42:50 2011 +0100
+++ b/test/contexts/subtle_init.rb	Tue Nov 15 21:43:06 2011 +0100
@@ -17,7 +17,7 @@
   end # }}}
 
   asserts 'Check colors' do # {{{
-    Subtlext::Subtle.colors.is_a? Hash and
+    Subtlext::Subtle.colors.is_a?(Hash) and
       COLORS_COUNT == Subtlext::Subtle.colors.size
   end # }}}
 
@@ -26,7 +26,7 @@
   end # }}}
 
   asserts 'Check spawn' do # {{{
-    if((xterm = find_executable0('xterm')).nil?)
+    if (xterm = find_executable0('xterm')).nil?
       raise 'xterm not found in path'
     else
       Subtlext::Subtle.spawn("#{xterm} -display :10")
--- a/test/contexts/tag.rb	Tue Nov 15 21:42:50 2011 +0100
+++ b/test/contexts/tag.rb	Tue Nov 15 21:43:06 2011 +0100
@@ -10,7 +10,7 @@
 #
 
 context 'Tag' do
-  TAG_COUNT = 12
+  TAG_COUNT = 13
   TAG_ID    = 1
   TAG_NAME  = 'terms'
 
@@ -25,7 +25,7 @@
   asserts 'Get list' do # {{{
     list = Subtlext::Tag.list
 
-    list.is_a? Array and TAG_COUNT == list.size and
+    list.is_a?(Array) and TAG_COUNT == list.size and
       Subtlext::Tag.method(:all) == Subtlext::Tag.method(:list)
   end # }}}
 
--- a/test/contexts/view.rb	Tue Nov 15 21:42:50 2011 +0100
+++ b/test/contexts/view.rb	Tue Nov 15 21:43:06 2011 +0100
@@ -38,7 +38,7 @@
     none   = Subtlext::View['abcdef']
 
     index == string and index == sym and
-      all.is_a? Array and VIEW_COUNT == all.size and
+      all.is_a?(Array) and VIEW_COUNT == all.size and
       none.nil?
   end # }}}
 
--- a/test/test.rb	Tue Nov 15 21:42:50 2011 +0100
+++ b/test/test.rb	Tue Nov 15 21:43:06 2011 +0100
@@ -32,7 +32,7 @@
 
 def fork_and_forget(cmd)
   pid = Process.fork
-  if(pid.nil?)
+  if pid.nil?
     exec(cmd)
   else
     Process.detach(pid)
@@ -40,7 +40,7 @@
 end
 
 # Find xterm
-if((xterm = find_executable0("xterm")).nil?)
+if (xterm = find_executable0("xterm")).nil?
   raise "xterm not found in path"
 end