summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-05-08 15:54:57 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-05-08 15:54:57 +0200
commite6f6ad8072532f879aaaffddebdbd0be4b749285 (patch)
tree0dadba527d0b3107b43d8c49f71c637419431247 /spec
parente4de8f2786d07723519dadcf7ba09da6e96895c6 (diff)
downloadffi-efl-e6f6ad8072532f879aaaffddebdbd0be4b749285.zip
ffi-efl-e6f6ad8072532f879aaaffddebdbd0be4b749285.tar.gz
spec cleanup
Diffstat (limited to 'spec')
-rw-r--r--spec/ecore_evas_spec.rb157
-rw-r--r--spec/edje_spec.rb31
-rw-r--r--spec/eina_hash_spec.rb2
-rw-r--r--spec/eina_list_spec.rb2
-rw-r--r--spec/elm_spec.rb147
-rw-r--r--spec/evas_spec.rb110
-rw-r--r--spec/helper.rb4
7 files changed, 255 insertions, 198 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
diff --git a/spec/edje_spec.rb b/spec/edje_spec.rb
index 19998e5..483ab95 100644
--- a/spec/edje_spec.rb
+++ b/spec/edje_spec.rb
@@ -42,7 +42,7 @@ describe Efl::Edje do
Edje.shutdown.should == 1
end
#
- it "frametime get/set should work" do
+ it "frametime get/set " do
Edje.frametime_set 10
Edje.frametime_get.should == 10
end
@@ -52,39 +52,39 @@ describe Efl::Edje do
Edje.thaw
end
#
- it "font_set_append should work" do
+ it "font_set_append " do
Edje.fontset_append_set "my font"
Edje.fontset_append_get.should == "my font"
end
#
- it "scale get/set should work" do
+ it "scale get/set " do
Edje.scale_set 0.3
Edje.scale_get.should == 0.3
end
#
- it "file_collection_list should work" do
+ it "file_collection_list " do
l = Efl::EinaList::REinaList.new Edje.file_collection_list EDJE_FILE
l.to_ary.length.should > 0
Edje.file_collection_list_free l
end
#
- it "file_group_exists should work" do
+ it "file_group_exists " do
Edje.file_group_exists(EDJE_FILE, "my_group").should be_true
Edje.file_group_exists(EDJE_FILE, "my_grup").should be_false
end
#
- it "file_data_get should work" do
+ it "file_data_get " do
Edje.file_data_get(EDJE_FILE, "key1").should == "val1"
Edje.file_data_get(EDJE_FILE, "key2").should == nil
end
#
- it "file_cache get/set should work" do
+ it "file_cache get/set " do
Edje.file_cache_set 2
Edje.file_cache_get.should == 2
Edje.file_cache_flush
end
#
- it "collection_cache get/set should work" do
+ it "collection_cache get/set " do
Edje.collection_cache_set 6
Edje.collection_cache_get.should == 6
Edje.collection_cache_flush
@@ -111,27 +111,22 @@ describe Efl::Edje do
Efl::Evas.shutdown
end
#
- it "scale get/set should work" do
+ it "scale get/set " do
@ed.scale_set 0.3
@ed.scale_get.should == 0.3
end
#
- it "mirrored get/set should work" do
- @ed.mirrored_set true
- @ed.mirrored_get.should be_true
- @ed.mirrored = false
- @ed.mirrored.should be_false
- @ed.mirrored?.should be_false
- @ed.mirrored_get.should be_false
+ it "mirrored get/set " do
+ bool_check @ed, 'mirrored'
end
#
- it "data_get hould work" do
+ it "data_get" do
@ed.data("key2").should == "val2"
@ed.data_get("key2").should == "val2"
@ed.data_get("key1").should == nil
end
#
- it "file_get should work" do
+ it "file_get " do
@ed.file_get[0].should == EDJE_FILE
@ed.file_get[1].should == "my_group"
end
diff --git a/spec/eina_hash_spec.rb b/spec/eina_hash_spec.rb
index 3c073c5..48347a4 100644
--- a/spec/eina_hash_spec.rb
+++ b/spec/eina_hash_spec.rb
@@ -167,7 +167,7 @@ describe Efl::EinaHash do
h[k3].read_string.should == "D3"
end
#
- it "alternate constructor should work" do
+ it "alternate constructor" do
cstr_cnt = 0
h = REinaHash.new { cstr_cnt+=1; Efl::Native.eina_hash_string_superfast_new FFI::Pointer::NULL }
cstr_cnt.should == 1
diff --git a/spec/eina_list_spec.rb b/spec/eina_list_spec.rb
index d19a372..0cf2501 100644
--- a/spec/eina_list_spec.rb
+++ b/spec/eina_list_spec.rb
@@ -92,7 +92,7 @@ describe Efl::EinaList do
l.free
end
#
- it "Enumerable should work" do
+ it "Enumerable" do
l = REinaList.new
d1 = ::FFI::MemoryPointer.from_string "D0"
d2 = ::FFI::MemoryPointer.from_string "D1"
diff --git a/spec/elm_spec.rb b/spec/elm_spec.rb
index 3f1c76e..774c9c3 100644
--- a/spec/elm_spec.rb
+++ b/spec/elm_spec.rb
@@ -1,8 +1,8 @@
#! /usr/bin/env ruby
# -*- coding: UTF-8 -*-
#
-require 'efl/eina'
require 'efl/elementary'
+require './spec/helper'
#
describe Efl::Elm do
#
@@ -14,23 +14,131 @@ describe Efl::Elm do
Elm.shutdown
}
#
- def realize_app
- @win = Elm::ElmWin.new(nil, 'TEST') do |w|
- w.title= 'spec win'
- w.move 100, 100
- w.resize 100, 100
- w.show
- end
- @bg = Elm::ElmBg.new(@win) do |bg|
- bg.size_hint_weight_set 1.0, 1.0
- bg.evas_object_color_set 200,255,100,150
- bg.show
+ describe Efl::Elm::ElmWin do
+ before(:each) {
+ realize_win
+ }
+ after(:each) {
+ @bg.free
+ @win.free
+ }
+ #
+ it "resize_object add/del" do
+ r = @win.evas.object_rectangle_add
+ @win.resize_object_add r
+ @win.resize_object_del r
+ end
+ #
+ it "title set/get" do
+ @win.title_set "title1"
+ @win.title_get.should == "title1"
+ @win.title= "title2"
+ @win.title.should == "title2"
+ end
+ #
+ it "autodel set/get" do
+ bool_check @win, 'autodel'
+ end
+ #
+ it "activate, lower, raise" do
+ @win.activate
+ @win.lower
+ @win.raise
+ end
+ #
+ it "borderless set/get" do
+ bool_check @win, 'borderless'
+ @win.borderless.should be_false
+ end
+ #
+ it "shaped set/get" do
+ bool_check @win, 'shaped'
+ end
+ #
+ it "alpha set/get" do
+ bool_check @win, 'alpha'
+ end
+ #
+ it "transparent set/get" do
+ bool_check @win, 'transparent'
+ end
+ #
+ it "override set/get" do
+ bool_check @win, 'override'
+ end
+ #
+ it "fullscreen set/get" do
+ bool_check @win, 'fullscreen', 4
+ end
+ # FIXME depends on issue: ecore-2
+ it "maximized set/get" do
+ bool_check @win, 'maximized', 3
+ end
+ #
+ it "iconified set/get" do
+ bool_check @win, 'iconified'
+ end
+ #
+ it "layet set/get" do
+ @win.layer_set 2
+ @win.layer_get.should == 2
+ @win.layer = 3
+ @win.layer.should == 3
+ end
+ #
+ it "rotation set/get" do
+ @win.rotation_set 90
+ @win.rotation_get.should == 90
+ @win.rotation = 180
+ @win.rotation.should == 180
+ @win.rotation_with_resize_set 90
+ @win.rotation_get.should == 90
+ @win.rotation_with_resize= 180
+ @win.rotation.should == 180
+ end
+ #
+ it "sticky set/get" do
+ bool_check @win, 'sticky', 3
+ end
+ #
+ it "conformant set/get" do
+ bool_check @win, 'conformant'
+ end
+ #
+ it "quickpanel set/get" do
+ bool_check @win, 'quickpanel'
end
+ # EAPI void elm_win_quickpanel_set(Evas_Object *obj, Eina_Bool quickpanel);
+ # EAPI Eina_Bool elm_win_quickpanel_get(const Evas_Object *obj);
+ # EAPI void elm_win_quickpanel_priority_major_set(Evas_Object *obj, int priority);
+ # EAPI int elm_win_quickpanel_priority_major_get(const Evas_Object *obj);
+ # EAPI void elm_win_quickpanel_priority_minor_set(Evas_Object *obj, int priority);
+ # EAPI int elm_win_quickpanel_priority_minor_get(const Evas_Object *obj);
+ # EAPI void elm_win_quickpanel_zone_set(Evas_Object *obj, int zone);
+ # EAPI int elm_win_quickpanel_zone_get(const Evas_Object *obj);
+ # EAPI void elm_win_prop_focus_skip_set(Evas_Object *obj, Eina_Bool skip);;
+ # EAPI void elm_win_illume_command_send(Evas_Object *obj, Elm_Illume_Command command, void *params);;
+ # EAPI Evas_Object *elm_win_inlined_image_object_get(Evas_Object *obj);
+ # EAPI void elm_win_focus_highlight_enabled_set(Evas_Object *obj, Eina_Bool enabled);
+ # EAPI Eina_Bool elm_win_focus_highlight_enabled_get(const Evas_Object *obj);
+ # EAPI void elm_win_focus_highlight_style_set(Evas_Object *obj, const char *style);
+ # EAPI const char *elm_win_focus_highlight_style_get(const Evas_Object *obj);
+ # EAPI void elm_win_keyboard_mode_set(Evas_Object *obj, Elm_Win_Keyboard_Mode mode);
+ # EAPI Elm_Win_Keyboard_Mode elm_win_keyboard_mode_get(const Evas_Object *obj);
+ # EAPI void elm_win_keyboard_win_set(Evas_Object *obj, Eina_Bool is_keyboard);
+ # EAPI Eina_Bool elm_win_keyboard_win_get(const Evas_Object *obj);
+ # EAPI void elm_win_screen_position_get(const Evas_Object *obj, int *x, int *y);
+ # EAPI Evas_Object *elm_win_inwin_add(Evas_Object *obj);
+ # EAPI void elm_win_inwin_activate(Evas_Object *obj);
+ # EAPI void elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content);
+ # EAPI Evas_Object *elm_win_inwin_content_get(const Evas_Object *obj);
+ # EAPI Evas_Object *elm_win_inwin_content_unset(Evas_Object *obj);
+ # EAPI Ecore_X_Window elm_win_xwindow_get(const Evas_Object *obj);
end
#
describe Efl::Elm::ElmBg do
before(:all) {
- realize_app
+ realize_win
}
after(:all) {
@bg.free
@@ -73,7 +181,7 @@ describe Efl::Elm do
describe Efl::Elm::ElmLabel do
#
before(:all) {
- realize_app
+ realize_win
@lb = Elm::ElmLabel.new @win
}
after(:all) {
@@ -112,14 +220,11 @@ describe Efl::Elm do
#
it "ellipsis_set" do
@lb.ellipsis_set true
- @lb.ellipsis= true
+ @lb.ellipsis= false
end
#
it "slide_set" do
- @lb.slide_set true
- @lb.slide_get.should be_true
- @lb.slide= false
- @lb.slide.should be_false
+ bool_check @lb, 'slide'
end
#
it "slide_duration_set" do
@@ -133,7 +238,7 @@ describe Efl::Elm do
describe Efl::Elm::ElmPager do
#
before(:all) {
- realize_app
+ realize_win
@p = Elm::ElmPager.new @win
@os = []
0.upto(3) do
@@ -164,7 +269,7 @@ describe Efl::Elm do
describe Efl::Elm::ElmPanel do
#
before(:all) {
- realize_app
+ realize_win
@p = Elm::ElmPanel.new @win
@os = []
}
diff --git a/spec/evas_spec.rb b/spec/evas_spec.rb
index 7099e12..f745298 100644
--- a/spec/evas_spec.rb
+++ b/spec/evas_spec.rb
@@ -91,7 +91,7 @@ describe Efl::Evas do
e4.to_ptr.should be_nil
end
#
- it "focus should work" do
+ it "focus " do
Native.evas_focus_in @e.to_ptr
Native.evas_focus_state_get(@e.to_ptr).should be_true
Native.evas_focus_out @e.to_ptr
@@ -108,12 +108,12 @@ describe Efl::Evas do
@e.focus_state { |r| r.should be_false }
end
#
- it "nochange should work" do
+ it "nochange " do
@e.nochange_push
@e.nochange_pop
end
#
- it "attach data should work" do
+ it "attach data " do
data = FFI::MemoryPointer.from_string "my data"
@e.data_attach_set data
@e.data_attach.read_string.should == "my data"
@@ -132,7 +132,7 @@ describe Efl::Evas do
@e.render_dump
end
#
- it "output method should work" do
+ it "output method " do
@e.output_method.should == Evas::render_method_lookup("buffer")
@e.output_method_get.should == Evas::render_method_lookup("buffer")
# output_method_set tested in before(:all)
@@ -140,12 +140,12 @@ describe Efl::Evas do
Evas::render_method_list_free l
end
#
- it "engine info should work" do
+ it "engine info " do
# engine_info_get and engine_info_set tested in before(:all)
true.should be_true
end
#
- it "output size should work" do
+ it "output size " do
@e.output_size_set 69, 666
@e.size.should == [69,666]
@e.output_size.should == [69,666]
@@ -154,7 +154,7 @@ describe Efl::Evas do
@e.size == [666,69]
end
#
- it "output viewport should work" do
+ it "output viewport " do
@e.output_viewport_set 0, 0, 666, 69
@e.viewport.should == [0,0,666,69]
@e.output_viewport.should == [0,0,666,69]
@@ -163,7 +163,7 @@ describe Efl::Evas do
@e.viewport.should == [0,0,69,666]
end
#
- it "coordinates evas<=>world should work" do
+ it "coordinates evas<=>world " do
@e.output_viewport_set 0, 0, 800, 600
x = @e.coord_screen_x_to_world 666
r = @e.coord_world_x_to_screen x
@@ -175,7 +175,7 @@ describe Efl::Evas do
r.should >= 67
end
#
- it "freeze and thaw should work" do
+ it "freeze and thaw " do
@e.event_freeze?.should == 0
@e.event_freeze
@e.event_freeze?.should == 1
@@ -183,14 +183,14 @@ describe Efl::Evas do
@e.event_freeze_get.should == 0
end
#
- it "up/down mouse event should work" do
+ it "up/down mouse event " do
@e.event_feed_mouse_down 2, :evas_button_double_click, Time.now.to_i, FFI::Pointer::NULL
@e.pointer_button_down_mask.should == 2
@e.event_feed_mouse_up 2, :evas_button_double_click, Time.now.to_i, FFI::Pointer::NULL
@e.pointer_button_down_mask_get.should == 0
end
#
- it "move mouse event should work" do
+ it "move mouse event " do
@e.pointer_output.should == [0,0]
@e.pointer_output_xy_get.should == [0,0]
@e.pointer_canvas.should == [0,0]
@@ -202,7 +202,7 @@ describe Efl::Evas do
@e.pointer_canvas_xy_get.should == [6,6]
end
#
- it "in/out mouse event should work" do
+ it "in/out mouse event " do
@e.pointer_inside_get.should be_false
@e.event_feed_mouse_in Time.now.to_i, FFI::Pointer::NULL
@e.pointer_inside.should be_true
@@ -220,7 +220,7 @@ describe Efl::Evas do
# evas_event_feed_key_up
# evas_event_feed_hold
#
- it "add/del event callback should work" do
+ it "add/del event callback " do
@cb = false
kd_cb = Proc.new do |data, e, obj, event_info|
data.read_string.should eq "mouse_in"
@@ -241,7 +241,7 @@ describe Efl::Evas do
@bg.free
end
#
- it "image cache functions should work" do
+ it "image cache functions " do
@e.image_cache_flush
@e.image_cache_reload
@e.image_cache_set 666
@@ -249,7 +249,7 @@ describe Efl::Evas do
@e.image_cache_get.should == 666
end
#
- it "font functions should work" do
+ it "font functions " do
@e.font_hinting_set :evas_font_hinting_bytecode
@e.font_hinting.should == :evas_font_hinting_bytecode
@e.font_hinting_get.should == :evas_font_hinting_bytecode
@@ -270,7 +270,7 @@ describe Efl::Evas do
end
end
#
- it "focus should work" do
+ it "focus " do
@e.focus.should == FFI::Pointer::NULL
@e.focus_get.should == FFI::Pointer::NULL
@o = @e.object_rectangle_add { |o|
@@ -285,7 +285,7 @@ describe Efl::Evas do
@o.free
end
#
- it "object_name_find should work" do
+ it "object_name_find " do
@e.object_name_find("name").should == FFI::Pointer::NULL
@o = @e.object_rectangle_add
@o.name="name"
@@ -315,7 +315,7 @@ describe Efl::Evas do
Evas.shutdown
end
#
- it "clipper should work" do
+ it "clipper " do
clipper = @e.object_rectangle_add
clipper.color = 255,255,255,255
clipper.move 25, 25
@@ -330,7 +330,7 @@ describe Efl::Evas do
end
#
- it "focus functions should work" do
+ it "focus functions " do
@o.focus.should be_false
@o.focus_set true
@o.focus_get.should be_true
@@ -338,7 +338,7 @@ describe Efl::Evas do
@o.focus_get.should be_false
end
#
- it "layer functions should work" do
+ it "layer functions " do
@o.layer.should == 0
@o.layer_set 2
@o.layer_get.should == 2
@@ -346,13 +346,13 @@ describe Efl::Evas do
@o.layer_get.should == 0
end
#
- it "name functions should work" do
+ it "name functions " do
@o.name_set "My name"
@o.evas_name.should == "My name"
@o.name_get.should == "My name"
end
#
- it "geometry functions should work" do
+ it "geometry functions " do
@o.geometry.should == [0,0,100,100]
@o.resize 50,50
@o.geometry.should == [0,0,50,50]
@@ -360,7 +360,7 @@ describe Efl::Evas do
@o.geometry_get.should == [10,10,50,50]
end
#
- it "center should work" do
+ it "center " do
@o.geometry.should == [10,10,50,50]
@o.center_get.should == [35,35]
@o.center.should == [35,35]
@@ -369,7 +369,7 @@ describe Efl::Evas do
@o.geometry.should == [25,25,50,50]
end
#
- it "show hide visible should work" do
+ it "show hide visible " do
@o.show
@o.visible?.should be_true
@o.hide
@@ -379,7 +379,7 @@ describe Efl::Evas do
@o.visible?.should be_true
end
#
- it "color get/set should work" do
+ it "color get/set " do
@o.color.should == [200,200,200,200]
@o.color_get.should == [200,200,200,200]
@o.color_set 0,50,100,200
@@ -393,12 +393,12 @@ describe Efl::Evas do
@o.evas_get.should === @e
end
#
- it "type_get should work" do
+ it "type_get " do
@o.evas_type.should == 'rectangle'
@o.type_get.should == 'rectangle'
end
# TODO raise, lower
- it "raise, lower, stck_below, stack_above should work" do
+ it "raise, lower, stck_below, stack_above " do
os = []
0.upto(3) do
os << @e.object_rectangle_add
@@ -416,7 +416,7 @@ describe Efl::Evas do
os.each do |o| o.free; end
end
#
- it "event_callback should work" do
+ it "event_callback " do
@o.move 0, 0 # FIXME why do I need this ?!?
count = 0
cb = Proc.new do |data,evas,evas_object,event_info|
@@ -429,7 +429,7 @@ describe Efl::Evas do
count.should==1
end
#
- it "pass events should work" do
+ it "pass events " do
@o.pass_events.should be_false
@o.pass_events_set true
@o.pass_events.should be_true
@@ -441,7 +441,7 @@ describe Efl::Evas do
@o.pass_events_get.should be_false
end
#
- it "repeat events should work" do
+ it "repeat events " do
@o.repeat_events.should be_false
@o.repeat_events_set true
@o.repeat_events.should be_true
@@ -453,7 +453,7 @@ describe Efl::Evas do
@o.repeat_events_get.should be_false
end
#
- it "propagate event should work" do
+ it "propagate event " do
@o.propagate_events.should be_true
@o.propagate_events=false
@o.propagate_events.should be_false
@@ -465,7 +465,7 @@ describe Efl::Evas do
@o.propagate_events_get.should be_true
end
#
- it "map enable should work" do
+ it "map enable " do
@o.map_enable.should be_false
@o.map_enable_set true
@o.map_enable.should be_true
@@ -477,7 +477,7 @@ describe Efl::Evas do
@o.map_enable_get.should be_false
end
#
- it "size_hint_ should work" do
+ it "size_hint_ " do
@o.size_hint_min_set 100, 150
@o.size_hint_min.should == [100,150]
@o.size_hint_min_get.should == [100,150]
@@ -501,7 +501,7 @@ describe Efl::Evas do
@o.size_hint_padding_get.should == [10,20,30,40]
end
#
- it "data get/set should work" do
+ it "data get/set " do
@o.data_set "key", "val"
@o.data("key").should == "val"
@o.data_get("key").should == "val"
@@ -509,7 +509,7 @@ describe Efl::Evas do
@o.data_get("key").should == nil
end
#
- it "pointer mode get/set should work" do
+ it "pointer mode get/set " do
@o.pointer_mode = :evas_object_pointer_mode_nograb
@o.pointer_mode.should == :evas_object_pointer_mode_nograb
@o.pointer_mode_get.should == :evas_object_pointer_mode_nograb
@@ -518,7 +518,7 @@ describe Efl::Evas do
@o.pointer_mode_get.should == :evas_object_pointer_mode_autograb
end
#
- it "anti_alias get/set should work" do
+ it "anti_alias get/set " do
@o.anti_alias_set true
@o.anti_alias_get.should be_true
@o.anti_alias=false
@@ -526,7 +526,7 @@ describe Efl::Evas do
@o.anti_alias_get.should be_false
end
#
- it "sccale set/get should work" do
+ it "sccale set/get " do
@o.scale_set 1.5
@o.scale_get.should == 1.5
@o.scale= 1.6
@@ -540,7 +540,7 @@ describe Efl::Evas do
@o.render_op.should == :evas_render_mask
end
#
- it "precise_is_inside get/set should work" do
+ it "precise_is_inside get/set " do
@o.precise_is_inside_set true
@o.precise_is_inside?.should be_true
@o.precise_is_inside_get.should be_true
@@ -549,7 +549,7 @@ describe Efl::Evas do
@o.precise_is_inside.should be_false
end
#
- it "static_clip get/set should work" do
+ it "static_clip get/set " do
@o.static_clip_set true
@o.static_clip?.should be_true
@o.static_clip_get.should be_true
@@ -572,7 +572,7 @@ describe Efl::Evas do
@e.free
Evas.shutdown
end
- it "xy get/set should work" do
+ it "xy get/set " do
@l.line_xy_set 10, 20, 30, 40
@l.line_xy_get.should == [10, 20, 30, 40]
end
@@ -590,14 +590,14 @@ describe Efl::Evas do
@e.free
Evas.shutdown
end
- it "xy point_add should work" do
+ it "xy point_add " do
@p.point_add 10, 20
@p.point_add 30, 40
@p.<< 50, 60
@p.<< 80, 80
end
#
- it "point clear shold work" do
+ it "point clear" do
@p.points_clear
end
end
@@ -615,21 +615,21 @@ describe Efl::Evas do
Evas.shutdown
end
#
- it "font_source get/set should work" do
+ it "font_source get/set " do
@t.font_source_set "myFont"
@t.font_source_get.should == "myFont"
@t.font_source = "myFont2"
@t.font_source.should == "myFont2"
end
#
- it "font get/set should work" do
+ it "font get/set " do
@t.font_set "Arial", 12
@t.font_get.should == ["Arial",12]
@t.font = "Ariall", 16
@t.font_get.should == ["Ariall",16]
end
#
- it "text set/get should work" do
+ it "text set/get " do
@t.text_set "hello"
@t.text_get.should == "hello"
@t.text="hello world"
@@ -657,14 +657,14 @@ describe Efl::Evas do
@t.style_pad.length.should == 4
end
#
- it "bidi_delimiters set/get should work" do
+ it "bidi_delimiters set/get " do
@t.bidi_delimiters_set "@"
@t.bidi_delimiters_get.should == "@"
@t.bidi_delimiters= "#"
@t.bidi_delimiters.should == "#"
end
#
- it "char_pos_get char_coords_get last_up_to_pos should work" do
+ it "char_pos_get char_coords_get last_up_to_pos " do
@t.text="hello world"
coords = @t.char_pos_get 6
@t.char_coords(coords[0], coords[1])[0].should == 6
@@ -675,35 +675,35 @@ describe Efl::Evas do
@t.last_up_to_pos(coords[0], coords[1]).should == 3
end
#
- it "style ste/get should work" do
+ it "style ste/get " do
@t.style_set :evas_text_style_shadow
@t.style_get.should == :evas_text_style_shadow
@t.style= :evas_text_style_outline
@t.style.should == :evas_text_style_outline
end
#
- it "shadow_color set/get should work" do
+ it "shadow_color set/get " do
@t.shadow_color_set 100, 150, 200, 50
@t.shadow_color_get.should == [100, 150, 200, 50]
@t.shadow_color = 100, 150, 200, 50
@t.shadow_color.should == [100, 150, 200, 50]
end
#
- it "glow_color set/get should work" do
+ it "glow_color set/get " do
@t.glow_color_set 100, 150, 200, 50
@t.glow_color_get.should == [100, 150, 200, 50]
@t.glow_color = 100, 150, 200, 50
@t.glow_color.should == [100, 150, 200, 50]
end
#
- it "glow2_color set/get should work" do
+ it "glow2_color set/get " do
@t.glow2_color_set 100, 150, 200, 50
@t.glow2_color_get.should == [100, 150, 200, 50]
@t.glow2_color = 100, 150, 200, 50
@t.glow2_color.should == [100, 150, 200, 50]
end
#
- it "outline_color set/get should work" do
+ it "outline_color set/get " do
@t.outline_color_set 100, 150, 200, 50
@t.outline_color_get.should == [100, 150, 200, 50]
@t.outline_color = 100, 150, 200, 50
@@ -729,7 +729,7 @@ describe Efl::Evas do
Evas.shutdown
end
#
- it "append, prepend, insert_before, insert_after, insert_at, remove, remove_at, remove_all and children_get should work" do
+ it "append, prepend, insert_before, insert_after, insert_at, remove, remove_at, remove_all and children_get " do
@b.append @os[4]
@b.prepend @os[0]
@b.insert_before @os[1], @os[4]
@@ -750,14 +750,14 @@ describe Efl::Evas do
@b.children.to_a.length.should == 0
end
#
- it "align set/get should work" do
+ it "align set/get " do
@b.align_set 0.2, 0.3
@b.align_get.should == [0.2,0.3]
@b.align = 0.3, 0.2
@b.align.should == [0.3,0.2]
end
#
- it "padding set/get should work" do
+ it "padding set/get " do
@b.padding_set 20, 30
@b.padding_get.should == [20,30]
@b.padding = 30, 20
diff --git a/spec/helper.rb b/spec/helper.rb
index 3c94fff..6b9c849 100644
--- a/spec/helper.rb
+++ b/spec/helper.rb
@@ -34,10 +34,14 @@ end
def bool_check t, fct, delay=nil
t.send fct+'_set', true
ecore_loop delay if delay
+ t.send(fct).should be_true
+ t.send(fct+'?').should be_true
t.send(fct+'_get').should be_true
t.send fct+'=', false
ecore_loop delay if delay
t.send(fct).should be_false
+ t.send(fct+'?').should be_false
+ t.send(fct+'_get').should be_false
end
#
def realize_win