diff options
Diffstat (limited to 'spec/evas_spec.rb')
-rw-r--r-- | spec/evas_spec.rb | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/spec/evas_spec.rb b/spec/evas_spec.rb index 663ca4b..78ac53a 100644 --- a/spec/evas_spec.rb +++ b/spec/evas_spec.rb @@ -51,4 +51,53 @@ describe Efl::Evas do Evas.async_events_process.should eql 0 Evas.shutdown end + # + describe Efl::Evas::Evas do + it "should be able to create and destroy evas" do + e1 = Evas::Evas.new + e1.ptr.address.should_not eql 0 + e2 = Evas::Evas.new e1 + e1.ptr.address.should eql e2.ptr.address + e3 = Evas::Evas.new e1.ptr + e1.ptr.address.should eql e3.ptr.address + e2.ptr.address.should eql e3.ptr.address + (e1==e2).should be_false + (e2==e3).should be_false + (e1==e3).should be_false + (e1===e2).should be_true + (e2===e3).should be_true + (e1===e3).should be_true + e1.free + e1.ptr.should be_nil + e4 = Evas::Evas.new Efl::API.evas_new + e4.ptr.address.should_not eql 0 + e5 = e4.dup + e4.ptr.address.should eql e5.ptr.address + e6 = e4.clone + e4.ptr.address.should eql e6.ptr.address + e4.free + e4.ptr.should be_nil + end + # + it "focus should work" do + e = Evas::Evas.new + Efl::API.evas_focus_in e.ptr + Efl::API.evas_focus_state_get(e.ptr).should be_true + Efl::API.evas_focus_out e.ptr + Efl::API.evas_focus_state_get(e.ptr).should be_false + Efl::Evas.focus_in e.ptr + Efl::Evas.focus_state_get(e.ptr).should be_true + Efl::Evas.focus_out e.ptr + Efl::Evas.focus_state_get(e.ptr).should be_false + e.focus_in { |r| r.should be_nil } + e.focus_state_get.should be_true + e.focus_state_get { |r| r.should be_true } + e.focus_out.should be_nil + e.focus_state_get.should be_false + e.focus_state_get { |r| r.should be_false } + e.free + end + # + end + # end |