diff options
Diffstat (limited to 'spec/ecore_evas_spec.rb')
-rw-r--r-- | spec/ecore_evas_spec.rb | 157 |
1 files changed, 55 insertions, 102 deletions
diff --git a/spec/ecore_evas_spec.rb b/spec/ecore_evas_spec.rb index a9abec9..3b4c934 100644 --- a/spec/ecore_evas_spec.rb +++ b/spec/ecore_evas_spec.rb @@ -2,16 +2,8 @@ # -*- coding: UTF-8 -*- # require 'efl/eina_list' -require 'efl/evas' -require 'efl/ecore' require 'efl/ecore_evas' -# -def ecore_loop n - n.downto(0) do - sleep 0.1 - Efl::Ecore.main_loop_iterate - end -end +require './spec/helper' # describe Efl::EcoreEvas do # @@ -33,7 +25,7 @@ describe Efl::EcoreEvas do EcoreEvas.shutdown.should == 1 end # - it "should work" do + it "engines get/list/free" do EcoreEvas.engines_free EcoreEvas.engines_get l = EcoreEvas.engines_list r = l.inject("\t") do |s,e| s+=e.read_string+' ' end @@ -41,7 +33,7 @@ describe Efl::EcoreEvas do EcoreEvas.engines_free l end # - it "ecore_evas_list should work" do + it "ecore_evas_list" do el = EcoreEvas.ecore_evas_list el.to_ary.length.should == 0 el.free @@ -78,16 +70,16 @@ describe Efl::EcoreEvas do EcoreEvas.shutdown end # - it "engine_name_get should work" do + it "engine_name_get " do @e.engine_name_get.should == "software_x11" end # - it "data get/set should work" do + it "data get/set " do @e.data_set 'key', '666' @e.data_get('key').read_string.should == '666' end # - it "move, resize move_resize and geometry_get should work (and check association)" do + it "move, resize move_resize and geometry_get (and check association)" do @e.geometry_get.should == [10,10,100,120] @bg.geometry_get.should == [0,0,100,120] @e.move 20, 17 # w+23 window bar height @@ -105,7 +97,7 @@ describe Efl::EcoreEvas do g = @e.geometry_get end # - it "rotation should work" do + it "rotation " do @e.rotation_set 25 @e.rotation_get.should == 25 @e.rotation = 50 @@ -114,31 +106,19 @@ describe Efl::EcoreEvas do @e.rotation_get.should == 0 end # - it "shaped get/set should work" do - @e.shaped?.should be_false - @e.shaped_set true - @e.shaped_get.should be_true - @e.shaped = false - @e.shaped?.should be_false + it "shaped get/set " do + bool_check @e, 'shaped' end # - it "alpha get/set should work" do - @e.alpha?.should be_false - @e.alpha_set true - @e.alpha_get.should be_true - @e.alpha = false - @e.alpha?.should be_false + it "alpha get/set " do + bool_check @e, 'alpha' end # - it "transparent get/set should work" do - @e.transparent?.should be_false - @e.transparent_set true - @e.transparent_get.should be_true - @e.transparent = false - @e.transparent?.should be_false + it "transparent get/set " do + bool_check @e, 'transparent' end # - it "show hide visibility should work" do + it "show hide visibility " do ecore_loop 3 @e.visibility?.should == 1 @e.hide @@ -149,13 +129,13 @@ describe Efl::EcoreEvas do @e.visibility?.should == 1 end # - it "raise lower activate should work" do + it "raise lower activate " do @e.raise @e.lower @e.activate end # - it "title set/get should work" do + it "title set/get " do @e.title_set "title" @e.title_get.should == "title" @e.title = "other" @@ -163,41 +143,41 @@ describe Efl::EcoreEvas do end # # - it "name_class set/get should work" do + it "name_class set/get " do @e.name_class_set "name", "class" @e.name_class_get.should == ['name','class'] @e.name_class = "name1", "class1" @e.name_class_get.should == ['name1','class1'] end # - it "size_min set/get should work" do + it "size_min set/get " do @e.size_min_set 20, 30 @e.size_min_get.should == [20, 30] end # - it "size_max set/get should work" do + it "size_max set/get " do @e.size_max_set 20, 30 @e.size_max_get.should == [20, 30] end # - it "size_base set/get should work" do + it "size_base set/get " do @e.size_base_set 20, 30 @e.size_base_get.should == [20, 30] end # - it "size_step set/get should work" do + it "size_step set/get " do @e.size_step_set 20, 30 @e.size_step_get.should == [20, 30] end # - it "layer set/get should work" do + it "layer set/get " do @e.layer_set 2 @e.layer_get.should == 2 @e.layer = 1 @e.layer?.should == 1 end # - it "focus set/get should work" do + it "focus set/get " do @e.focus?.should be_false @e.focus_set true ecore_loop 3 @@ -205,49 +185,35 @@ describe Efl::EcoreEvas do @e.focus?.should be_true end # - it "iconified set/get should work" do - @e.iconified_set true - @e.iconified_get.should be_true - @e.iconified = false - @e.iconified?.should be_false + it "iconified set/get " do + bool_check @e, 'iconified' end # - it "borderless set/get should work" do - @e.borderless_set true - @e.borderless_get.should be_true - @e.borderless = false - @e.borderless?.should be_false + it "borderless set/get " do + bool_check @e, 'borderless' end # - it "override set/get should work" do - @e.override_set true - @e.override_get.should be_true - @e.override = false - @e.override?.should be_false + it "override set/get " do + bool_check @e, 'override' end # # FIXME maximized # ecore/src/lib/ecore_evas/ecore_evas.c => ecore_evas_maximized_set => IFC => return -# it "maximized set/get should work" do -# @e.maximized?.should be_false -# @e.maximized_set true -# ecore_loop 10 -# @e.maximized_get.should be_true -# @e.maximized = false -# ecore_loop 3 -# @e.maximized?.should be_false -# end - # - it "fullscreen set/get should work" do - @e.fullscreen_set true - ecore_loop 3 - @e.fullscreen_get.should be_true - @e.fullscreen = false + it "maximized set/get " do + @e.maximized?.should be_false + @e.maximized_set true + ecore_loop 10 + @e.maximized_get.should be_true + @e.maximized = false ecore_loop 3 - @e.fullscreen?.should be_false + @e.maximized?.should be_false end # - it "avoid_damage set/get should work" do + it "fullscreen set/get " do + bool_check @e, 'fullscreen', 3 + end + # + it "avoid_damage set/get " do @e.avoid_damage_set :ecore_evas_avoid_damage_expose ecore_loop 3 @e.avoid_damage_get.should == :ecore_evas_avoid_damage_expose @@ -256,44 +222,31 @@ describe Efl::EcoreEvas do @e.avoid_damage?.should == :ecore_evas_avoid_damage_built_in end # - it "withdrawn set/get should work" do - @e.withdrawn_set true - @e.withdrawn_get.should be_true - @e.withdrawn = false - @e.withdrawn?.should be_false + it "withdrawn set/get " do + bool_check @e, 'withdrawn' end # - it "sticky set/get should work" do - @e.sticky_set true - ecore_loop 3 - @e.sticky_get.should be_true - @e.sticky = false - ecore_loop 3 - @e.sticky?.should be_false + it "sticky set/get " do + bool_check @e, 'sticky', 3 end # - it "ignore_events set/get should work" do - @e.ignore_events_set true - @e.ignore_events_get.should be_true - @e.ignore_events = false - @e.ignore_events?.should be_false + it "ignore_events set/get " do + bool_check @e, 'ignore_events' end # - it "manual_render set/get should work" do + it "manual_render set/get " do @e.manual_render_set true @e.manual_render_get.should be_true @e.manual_render = false @e.manual_render?.should be_false + @e.manual_render.should be_nil end # - it "comp_sync set/get should work" do - @e.comp_sync_set true - @e.comp_sync_get.should be_true - @e.comp_sync = false - @e.comp_sync?.should be_false + it "comp_sync set/get " do + bool_check @e, 'comp_sync' end # - it "ecore_evas_callback_resize should work" do + it "ecore_evas_callback_resize " do cpt = 0 cb = Proc.new do |ecore_evas| cpt+=1 @@ -304,7 +257,7 @@ describe Efl::EcoreEvas do cpt.should >0 end # - it "ecore_evas_callback_move should work" do + it "ecore_evas_callback_move " do cpt = 0 cb = Proc.new do |ecore_evas| cpt+=1 @@ -315,7 +268,7 @@ describe Efl::EcoreEvas do cpt.should >0 end # - it "ecore_evas_callback_show should work" do + it "ecore_evas_callback_show " do cpt = 0 cb = Proc.new do |ecore_evas| cpt+=1 @@ -326,7 +279,7 @@ describe Efl::EcoreEvas do cpt.should >0 end # - it "ecore_evas_callback_hide should work" do + it "ecore_evas_callback_hide " do cpt = 0 cb = Proc.new do |ecore_evas| cpt+=1 |