changeset 3169:9a5a97c0c6fd

Updated #277: Added related tests
author unexist
date Tue, 03 Jan 2012 21:43:30 +0100
parents 4733bdd6f197
children c1550d59a52a
files test/contexts/client.rb test/contexts/color.rb test/contexts/geometry.rb test/contexts/gravity.rb test/contexts/icon.rb test/contexts/screen.rb test/contexts/sublet.rb test/contexts/tag.rb test/contexts/tray.rb test/contexts/view.rb
diffstat 10 files changed, 48 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/test/contexts/client.rb	Tue Jan 03 17:02:50 2012 +0100
+++ b/test/contexts/client.rb	Tue Jan 03 21:43:30 2012 +0100
@@ -52,6 +52,10 @@
     topic.eql?(Subtlext::Client.current) and topic == topic
   end # }}}
 
+  asserts 'Hash and unique' do # {{{
+    1 == [ topic, topic ].uniq.size
+  end # }}}
+
   asserts 'Convert to string' do # {{{
     CLIENT_NAME == topic.to_str
   end # }}}
--- a/test/contexts/color.rb	Tue Jan 03 17:02:50 2012 +0100
+++ b/test/contexts/color.rb	Tue Jan 03 21:43:30 2012 +0100
@@ -38,6 +38,10 @@
     topic.eql?(Subtlext::Color.new('#ff0000')) and topic == topic
   end # }}}
 
+  asserts 'Hash and unique' do # {{{
+    1 == [ topic, topic ].uniq.size
+  end # }}}
+
   asserts 'Convert to string' do # {{{
     topic.to_str.match(/<>#[0-9]+<>/)
   end # }}}
--- a/test/contexts/geometry.rb	Tue Jan 03 17:02:50 2012 +0100
+++ b/test/contexts/geometry.rb	Tue Jan 03 21:43:30 2012 +0100
@@ -38,6 +38,10 @@
     topic.eql?(Subtlext::Geometry.new(0, 0, 1, 1)) and topic == topic
   end # }}}
 
+  asserts 'Hash and unique' do # {{{
+    1 == [ topic, topic ].uniq.size
+  end # }}}
+
   asserts 'Convert to string' do # {{{
     '0x0+1+1' == topic.to_str
   end # }}}
--- a/test/contexts/gravity.rb	Tue Jan 03 17:02:50 2012 +0100
+++ b/test/contexts/gravity.rb	Tue Jan 03 21:43:30 2012 +0100
@@ -53,6 +53,10 @@
     topic.eql?(Subtlext::Gravity.first(GRAVITY_ID)) and topic == topic
   end # }}}
 
+  asserts 'Hash and unique' do # {{{
+    1 == [ topic, topic ].uniq.size
+  end # }}}
+
   asserts 'Check associations' do # {{{
     clients = topic.clients
 
--- a/test/contexts/icon.rb	Tue Jan 03 17:02:50 2012 +0100
+++ b/test/contexts/icon.rb	Tue Jan 03 21:43:30 2012 +0100
@@ -9,20 +9,24 @@
 # See the file COPYING for details.
 #
 
-context "Icon" do
+context 'Icon' do
   setup do # {{{
-    Subtlext::Icon.new("icon/clock.xbm")
+    Subtlext::Icon.new('icon/clock.xbm')
   end # }}}
 
-  asserts("Equal and compare") do # {{{
+  asserts 'Equal and compare' do # {{{
     topic.eql?(Subtlext::Icon.new(8, 8)) and topic == topic
   end # }}}
 
-  asserts("Check attributes") do # {{{
+  asserts 'Hash and unique' do # {{{
+    1 == [ topic, topic ].uniq.size
+  end # }}}
+
+  asserts 'Check attributes' do # {{{
     8 == topic.height and 8 == topic.width
   end # }}}
 
-  asserts("Draw routines") do # {{{
+  asserts 'Draw routines' do # {{{
     topic.draw_point(1, 1)
     topic.draw_rect(1, 1, 6, 6, false)
     topic.clear
@@ -30,15 +34,15 @@
     true
   end # }}}
 
-  asserts("Copy area") do # {{{
-    icon = Subtlext::Icon.new("icon/clock.xbm")
+  asserts 'Copy area' do # {{{
+    icon = Subtlext::Icon.new('icon/clock.xbm')
 
     topic.copy_area(icon, 0, 0, 4, 4, 2, 2)
 
     true
   end # }}}
 
-  asserts("Convert to string") do # {{{
+  asserts 'Convert to string' do # {{{
     topic.to_str.match(/<>![0-9]+<>/)
   end # }}}
 end
--- a/test/contexts/screen.rb	Tue Jan 03 17:02:50 2012 +0100
+++ b/test/contexts/screen.rb	Tue Jan 03 21:43:30 2012 +0100
@@ -43,6 +43,10 @@
     topic.eql?(Subtlext::Screen.current) and topic == topic
   end # }}}
 
+  asserts 'Hash and unique' do # {{{
+    1 == [ topic, topic ].uniq.size
+  end # }}}
+
   asserts 'Change view' do # {{{
     view1 = topic.view
 
--- a/test/contexts/sublet.rb	Tue Jan 03 17:02:50 2012 +0100
+++ b/test/contexts/sublet.rb	Tue Jan 03 21:43:30 2012 +0100
@@ -58,6 +58,10 @@
     topic.eql?(topic) and topic == topic
   end # }}}
 
+  asserts 'Hash and unique' do # {{{
+    1 == [ topic, topic ].uniq.size
+  end # }}}
+
   asserts 'Convert to string' do # {{{
     SUBLET_NAME == topic.to_str
   end # }}}
--- a/test/contexts/tag.rb	Tue Jan 03 17:02:50 2012 +0100
+++ b/test/contexts/tag.rb	Tue Jan 03 21:43:30 2012 +0100
@@ -52,6 +52,10 @@
     topic.eql?(Subtlext::Tag.first(TAG_ID)) and topic == topic
   end # }}}
 
+  asserts 'Hash and unique' do # {{{
+    1 == [ topic, topic ].uniq.size
+  end # }}}
+
   asserts 'Check associations' do # {{{
     clients = topic.clients
     views   = topic.views
--- a/test/contexts/tray.rb	Tue Jan 03 17:02:50 2012 +0100
+++ b/test/contexts/tray.rb	Tue Jan 03 21:43:30 2012 +0100
@@ -51,6 +51,10 @@
     topic.eql?(Subtlext::Tray.first(TRAY_ID)) and topic == topic
   end # }}}
 
+  asserts 'Hash and unique' do # {{{
+    1 == [ topic, topic ].uniq.size
+  end # }}}
+
   asserts 'Convert to string' do # {{{
     TRAY_NAME == topic.to_str
   end # }}}
--- a/test/contexts/view.rb	Tue Jan 03 17:02:50 2012 +0100
+++ b/test/contexts/view.rb	Tue Jan 03 21:43:30 2012 +0100
@@ -53,6 +53,10 @@
     topic.eql?(Subtlext::View.first(VIEW_ID)) and topic == topic
   end # }}}
 
+  asserts 'Hash and unique' do # {{{
+    1 == [ topic, topic ].uniq.size
+  end # }}}
+
   asserts 'Check associations' do # {{{
     clients = topic.clients
     tags    = topic.tags