summaryrefslogtreecommitdiffstats
path: root/spec/ecore_spec.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-05-01 21:57:51 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-05-01 21:57:51 +0200
commit384be4b3aacbb84801f2cf585ec4ecc97d975730 (patch)
treee80f803f3c8514dd97da84186fc2a57d3d83ce18 /spec/ecore_spec.rb
parentd0b20b515e55dad3328191984bce5c898193446d (diff)
downloadffi-efl-384be4b3aacbb84801f2cf585ec4ecc97d975730.zip
ffi-efl-384be4b3aacbb84801f2cf585ec4ecc97d975730.tar.gz
specs : use == instead of eql
Diffstat (limited to 'spec/ecore_spec.rb')
-rw-r--r--spec/ecore_spec.rb74
1 files changed, 37 insertions, 37 deletions
diff --git a/spec/ecore_spec.rb b/spec/ecore_spec.rb
index fb68c37..58a5387 100644
--- a/spec/ecore_spec.rb
+++ b/spec/ecore_spec.rb
@@ -8,16 +8,16 @@ describe Efl::Ecore do
before(:all) do
Ecore = Efl::Ecore
USER_SIGNAL_CB = Proc.new do |data, type, event|
- data.read_string.should eql "ok"
- type.should eql Ecore::EVENT_SIGNAL_USER
- event.read_int.should eql 666
- Ecore.event_current_type_get.should eql Ecore::EVENT_SIGNAL_USER
- Ecore.event_current_event_get.address.should eql event.address
+ data.read_string.should == "ok"
+ type.should == Ecore::EVENT_SIGNAL_USER
+ event.read_int.should == 666
+ Ecore.event_current_type_get.should == Ecore::EVENT_SIGNAL_USER
+ Ecore.event_current_event_get.address.should == event.address
Ecore.main_loop_quit
end
EVENT_FREE_CB = Proc.new do |data,event|
- data.read_string.should eql "none"
- event.read_int.should eql 666
+ data.read_string.should == "none"
+ event.read_int.should == 666
end
OK = FFI::MemoryPointer.from_string "ok"
KO = FFI::MemoryPointer.from_string "ko"
@@ -25,15 +25,15 @@ describe Efl::Ecore do
end
#
it "should init" do
- Ecore.init.should eql 1
- Ecore.init.should eql 2
- Ecore.init.should eql 3
+ Ecore.init.should == 1
+ Ecore.init.should == 2
+ Ecore.init.should == 3
end
#
it "should shutdown" do
- Ecore.shutdown.should eql 2
- Ecore.shutdown.should eql 1
- Ecore.shutdown.should eql 0
+ Ecore.shutdown.should == 2
+ Ecore.shutdown.should == 1
+ Ecore.shutdown.should == 0
end
#
it "should run a single iteration of the mainloop" do
@@ -45,9 +45,9 @@ describe Efl::Ecore do
it 'should write and read data from pipe' do
data = FFI::MemoryPointer.from_string("none")
cb = Proc.new do |data,buffer,bytes|
- data.read_string.should eql 'none'
- buffer.read_string.should eql 'hello world'
- bytes.should eql 12
+ data.read_string.should == 'none'
+ buffer.read_string.should == 'hello world'
+ bytes.should == 12
end
Ecore.init
pipe = Ecore::REcorePipe.new cb, data
@@ -55,7 +55,7 @@ describe Efl::Ecore do
Ecore.main_loop_iterate
pipe.read_close
pipe.write_close
- pipe.del.address.should eql data.address
+ pipe.del.address.should == data.address
Ecore.shutdown
end
#
@@ -66,13 +66,13 @@ describe Efl::Ecore do
# add, del, add event handler
evt_handler = Ecore.event_handler_add Ecore::EVENT_SIGNAL_USER, USER_SIGNAL_CB, KO
evt_handler.null?.should be_false
- Ecore.event_handler_del(evt_handler).address.should eql KO.address
+ Ecore.event_handler_del(evt_handler).address.should == KO.address
evt_handler = Ecore.event_handler_add Ecore::EVENT_SIGNAL_USER, USER_SIGNAL_CB, OK
evt_handler.null?.should be_false
# add, del, add event
ecore_evt = Ecore.event_add Ecore::EVENT_SIGNAL_USER, evt, EVENT_FREE_CB, NONE
ecore_evt.null?.should be_false
- Ecore.event_del(ecore_evt).address.should eql NONE.address
+ Ecore.event_del(ecore_evt).address.should == NONE.address
ecore_evt = Ecore.event_add Ecore::EVENT_SIGNAL_USER, evt, EVENT_FREE_CB, NONE
ecore_evt.null?.should be_false
Ecore.main_loop_begin # process event
@@ -85,9 +85,9 @@ describe Efl::Ecore do
evt.write_int 666
evt_handler = Ecore.event_handler_add Ecore::EVENT_SIGNAL_USER, USER_SIGNAL_CB, KO
evt_handler.null?.should be_false
- Ecore.event_handler_data_get(evt_handler).read_string.should eql "ko"
- Ecore.event_handler_data_set(evt_handler, OK).address.should eql KO.address
- Ecore.event_handler_data_get(evt_handler).read_string.should eql "ok"
+ Ecore.event_handler_data_get(evt_handler).read_string.should == "ko"
+ Ecore.event_handler_data_set(evt_handler, OK).address.should == KO.address
+ Ecore.event_handler_data_get(evt_handler).read_string.should == "ok"
ecore_evt = Ecore.event_add Ecore::EVENT_SIGNAL_USER, evt, EVENT_FREE_CB, NONE
ecore_evt.null?.should be_false
Ecore.main_loop_begin # process event
@@ -96,9 +96,9 @@ describe Efl::Ecore do
#
it "should be able to create new event type" do
Ecore.init
- Ecore.event_type_new.should_not eql 0
- Ecore.event_type_new.should_not eql 0
- Ecore.event_type_new.should_not eql 0
+ Ecore.event_type_new.should_not == 0
+ Ecore.event_type_new.should_not == 0
+ Ecore.event_type_new.should_not == 0
Ecore.shutdown
end
#
@@ -106,31 +106,31 @@ describe Efl::Ecore do
Ecore.init
loop_data = FFI::MemoryPointer.from_string("loop_data")
event_free_cb = Proc.new do |data,event|
- data.read_string.should eql "ko"
- event.read_int.should eql 69
+ data.read_string.should == "ko"
+ event.read_int.should == 69
end
start_cb = Proc.new do |data|
- data.read_string.should eql "ok"
+ data.read_string.should == "ok"
loop_data
end
count = 0
filter_cb = Proc.new do |data,loop_data,type,event|
- data.read_string.should eql "ok"
- loop_data.read_string.should eql "loop_data"
- type.should eql Ecore::EVENT_SIGNAL_USER
+ data.read_string.should == "ok"
+ loop_data.read_string.should == "loop_data"
+ type.should == Ecore::EVENT_SIGNAL_USER
count += 1
if event.read_int == 69
- count.should eql 1
+ count.should == 1
false # drop first event
else
- count.should eql 2
- event.read_int.should eql 666
+ count.should == 2
+ event.read_int.should == 666
true
end
end
end_cb = Proc.new do |data,loop_data|
- data.read_string.should eql "ok"
- loop_data.read_string.should eql "loop_data"
+ data.read_string.should == "ok"
+ loop_data.read_string.should == "loop_data"
end
filter = Ecore.event_filter_add start_cb, filter_cb, end_cb, OK
Ecore.event_handler_add Ecore::EVENT_SIGNAL_USER, USER_SIGNAL_CB, OK
@@ -141,7 +141,7 @@ describe Efl::Ecore do
e2.write_int 666
evt2 = Ecore.event_add Ecore::EVENT_SIGNAL_USER, e2, EVENT_FREE_CB, NONE
Ecore.main_loop_begin # process event
- Ecore.event_filter_del(filter).address.should eql OK.address
+ Ecore.event_filter_del(filter).address.should == OK.address
evt2 = Ecore.event_add Ecore::EVENT_SIGNAL_USER, e2, EVENT_FREE_CB, NONE
Ecore.main_loop_begin # process event
Ecore.shutdown