summaryrefslogtreecommitdiffstats
path: root/spec/helper.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-05-08 15:02:08 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-05-08 15:02:08 +0200
commitb4aa3eaf1991eb160288c1c534567b4c43b8c273 (patch)
treec9dc67bdf4af12ab0c37b4850861459a30aa6510 /spec/helper.rb
parent22c6cdc480b8d422eb39562a6f145b510aa7069a (diff)
downloadffi-efl-b4aa3eaf1991eb160288c1c534567b4c43b8c273.zip
ffi-efl-b4aa3eaf1991eb160288c1c534567b4c43b8c273.tar.gz
add realize_win, ecore_loop, bool_check into spec/helper
Diffstat (limited to 'spec/helper.rb')
-rw-r--r--spec/helper.rb35
1 files changed, 34 insertions, 1 deletions
diff --git a/spec/helper.rb b/spec/helper.rb
index 9ba137a..3c94fff 100644
--- a/spec/helper.rb
+++ b/spec/helper.rb
@@ -1,6 +1,10 @@
#! /usr/bin/env ruby
# -*- coding: UTF-8 -*-
#
+require 'efl/eina'
+require 'efl/evas'
+require 'efl/ecore'
+#
def realize_evas
width = 300
height = 200
@@ -19,4 +23,33 @@ def realize_evas
einfo[:info][:func][:free_update_region] = nil #FFI::Pointer::NULL;
@e.engine_info_set einfo
end
-
+#
+def ecore_loop n
+ n.downto(0) do
+ sleep 0.1
+ Efl::Ecore.main_loop_iterate
+ end
+end
+#
+def bool_check t, fct, delay=nil
+ t.send fct+'_set', true
+ ecore_loop delay if delay
+ t.send(fct+'_get').should be_true
+ t.send fct+'=', false
+ ecore_loop delay if delay
+ t.send(fct).should be_false
+end
+#
+def realize_win
+ @win = Elm::ElmWin.new(nil, 'TEST') do |w|
+ w.title= 'spec win'
+ w.move 100, 100
+ w.resize 100, 100
+ 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
+ end
+ @win.show
+end