diff options
-rw-r--r-- | spec/ecore_getopt_spec.rb | 129 | ||||
-rw-r--r-- | spec/ecore_input_spec.rb | 12 | ||||
-rw-r--r-- | spec/ecore_spec.rb | 74 | ||||
-rw-r--r-- | spec/edje_spec.rb | 12 | ||||
-rw-r--r-- | spec/eet_spec.rb | 36 | ||||
-rw-r--r-- | spec/eina_hash_spec.rb | 93 | ||||
-rw-r--r-- | spec/eina_list_spec.rb | 16 | ||||
-rw-r--r-- | spec/eina_spec.rb | 12 | ||||
-rw-r--r-- | spec/evas_spec.rb | 116 |
9 files changed, 251 insertions, 249 deletions
diff --git a/spec/ecore_getopt_spec.rb b/spec/ecore_getopt_spec.rb index 7e6e5d9..586fe19 100644 --- a/spec/ecore_getopt_spec.rb +++ b/spec/ecore_getopt_spec.rb @@ -1,6 +1,7 @@ #! /usr/bin/env ruby # -*- coding: UTF-8 -*- # +require 'efl/ecore' require 'efl/ecore_getopt' # describe Efl::EcoreGetopt do @@ -10,10 +11,10 @@ describe Efl::EcoreGetopt do # @p = Efl::EcoreGetopt::REcoreGetopt.new :prog =>"Prog", :usage => "Usage", :version => "0.0.0", :copyright => "less", :license => "MIT", :description => "description", :strict => 1 @callback = Proc.new do |parser, desc, string, data, value| - parser.address.should eql @p.to_ptr.address - string.should eql "my_data" - data.read_string.should eql "cb_data" - value.read_pointer.read_int.should eql 99 + parser.address.should == @p.to_ptr.address + string.should == "my_data" + data.read_string.should == "cb_data" + value.read_pointer.read_int.should == 99 true end # @@ -93,130 +94,130 @@ describe Efl::EcoreGetopt do describe "license copyright version help" do it "should handle -L" do [ :license, :copyright, :version, :help ].each do |sym| - @values[sym].read_char.should eql 0 + @values[sym].read_char.should == 0 end args = @p.parse ["My lovely prog name","-L"] - @values[:license].read_char.should eql 1 + @values[:license].read_char.should == 1 [ :copyright, :version, :help ].each do |sym| - @values[sym].read_char.should eql 0 + @values[sym].read_char.should == 0 end end it "should handle --license" do [ :license, :copyright, :version, :help ].each do |sym| - @values[sym].read_char.should eql 0 + @values[sym].read_char.should == 0 end args = @p.parse ["My lovely prog name","--license"] - @values[:license].read_char.should eql 1 + @values[:license].read_char.should == 1 [ :copyright, :version, :help ].each do |sym| - @values[sym].read_char.should eql 0 + @values[sym].read_char.should == 0 end end it "should handle -C" do [ :license, :copyright, :version, :help ].each do |sym| - @values[sym].read_char.should eql 0 + @values[sym].read_char.should == 0 end args = @p.parse ["progname","-C"] - @values[:copyright].read_char.should eql 1 + @values[:copyright].read_char.should == 1 [ :license, :version, :help ].each do |sym| - @values[sym].read_char.should eql 0 + @values[sym].read_char.should == 0 end end it "should handle --copyright" do [ :license, :copyright, :version, :help ].each do |sym| - @values[sym].read_char.should eql 0 + @values[sym].read_char.should == 0 end args = @p.parse ["My lovely prog name","--copyright"] - @values[:copyright].read_char.should eql 1 + @values[:copyright].read_char.should == 1 [ :license, :version, :help ].each do |sym| - @values[sym].read_char.should eql 0 + @values[sym].read_char.should == 0 end end it "should handle -V" do [ :license, :copyright, :version, :help ].each do |sym| - @values[sym].read_char.should eql 0 + @values[sym].read_char.should == 0 end args = @p.parse ["My lovely prog name","-V"] - @values[:version].read_char.should eql 1 + @values[:version].read_char.should == 1 [ :license, :copyright, :help ].each do |sym| - @values[sym].read_char.should eql 0 + @values[sym].read_char.should == 0 end end it "should handle --version" do [ :license, :copyright, :version, :help ].each do |sym| - @values[sym].read_char.should eql 0 + @values[sym].read_char.should == 0 end args = @p.parse ["progname","--version"] - @values[:version].read_char.should eql 1 + @values[:version].read_char.should == 1 [ :license, :copyright, :help ].each do |sym| - @values[sym].read_char.should eql 0 + @values[sym].read_char.should == 0 end end it "should handle -H" do [ :license, :copyright, :version, :help ].each do |sym| - @values[sym].read_char.should eql 0 + @values[sym].read_char.should == 0 end args = @p.parse ["My lovely prog name","-H"] - @values[:help].read_char.should eql 1 + @values[:help].read_char.should == 1 [ :license, :copyright, :version ].each do |sym| - @values[sym].read_char.should eql 0 + @values[sym].read_char.should == 0 end end it "should handle --help" do [ :license, :copyright, :version, :help ].each do |sym| - @values[sym].read_char.should eql 0 + @values[sym].read_char.should == 0 end args = @p.parse ["progname","--help"] - @values[:help].read_char.should eql 1 + @values[:help].read_char.should == 1 [ :license, :copyright, :version ].each do |sym| - @values[sym].read_char.should eql 0 + @values[sym].read_char.should == 0 end end end describe "simple short options" do it "should handle -i" do - @values[:int].read_int.should eql 0 + @values[:int].read_int.should == 0 args = @p.parse ["progname","-i 666"] - @values[:int].read_int.should eql 666 + @values[:int].read_int.should == 666 end it "should handle -d" do - @values[:double].read_double.should eql 3.1415926 + @values[:double].read_double.should == 3.1415926 args = @p.parse ["progname","-d 6.66"] - @values[:double].read_double.should eql 6.66 + @values[:double].read_double.should == 6.66 end it "should handle -s" do - @values[:short].read_short.should eql 9 + @values[:short].read_short.should == 9 args = @p.parse ["progname","-s 125"] - @values[:short].read_short.should eql 125 + @values[:short].read_short.should == 125 end it "should handle -l" do - @values[:long].read_long.should eql 666 + @values[:long].read_long.should == 666 args = @p.parse ["progname","-l 69"] - @values[:long].read_long.should eql 69 + @values[:long].read_long.should == 69 end it "should handle -c" do - @values[:const].read_int.should eql -666 + @values[:const].read_int.should == -666 args = @p.parse ["progname","-c"] - @values[:const].read_int.should eql 123456 + @values[:const].read_int.should == 123456 end it "should handle -t" do - @values[:false].read_uchar.should eql 0 + @values[:false].read_uchar.should == 0 args = @p.parse ["progname","-t"] - @values[:false].read_uchar.should eql 1 + @values[:false].read_uchar.should == 1 end it "should handle -f" do - @values[:true].read_uchar.should eql 1 + @values[:true].read_uchar.should == 1 args = @p.parse ["progname","-f"] - @values[:true].read_uchar.should eql 0 + @values[:true].read_uchar.should == 0 end it "should handle -m" do - @values[:choice].read_pointer.should eql FFI::Pointer::NULL + @values[:choice].read_pointer.should == FFI::Pointer::NULL args = @p.parse ["progname","-mch2"] - @values[:choice].read_pointer.read_string.should eql "ch2" + @values[:choice].read_pointer.read_string.should == "ch2" end it "should handle -k" do - @values[:count].read_int.should eql 664 + @values[:count].read_int.should == 664 args = @p.parse ["progname","-kk"] - @values[:count].read_int.should eql 666 + @values[:count].read_int.should == 666 end it "should handle -b" do args = @p.parse ["progname","-bmy_data"] @@ -224,49 +225,49 @@ describe Efl::EcoreGetopt do end describe "simple long options" do it "should handle --int" do - @values[:int].read_int.should eql 0 + @values[:int].read_int.should == 0 args = @p.parse ["progname","--int=666"] - @values[:int].read_int.should eql 666 + @values[:int].read_int.should == 666 end it "should handle --double" do - @values[:double].read_double.should eql 3.1415926 + @values[:double].read_double.should == 3.1415926 args = @p.parse ["progname","--double=6.66"] - @values[:double].read_double.should eql 6.66 + @values[:double].read_double.should == 6.66 end it "should handle --short" do - @values[:short].read_short.should eql 9 + @values[:short].read_short.should == 9 args = @p.parse ["progname","--short=125"] - @values[:short].read_short.should eql 125 + @values[:short].read_short.should == 125 end it "should handle --long" do - @values[:long].read_long.should eql 666 + @values[:long].read_long.should == 666 args = @p.parse ["progname","--long=69"] - @values[:long].read_long.should eql 69 + @values[:long].read_long.should == 69 end it "should handle --const" do - @values[:const].read_int.should eql -666 + @values[:const].read_int.should == -666 args = @p.parse ["progname","--const"] - @values[:const].read_int.should eql 123456 + @values[:const].read_int.should == 123456 end it "should handle --true" do - @values[:false].read_uchar.should eql 0 + @values[:false].read_uchar.should == 0 args = @p.parse ["progname","--true"] - @values[:false].read_uchar.should eql 1 + @values[:false].read_uchar.should == 1 end it "should handle --false" do - @values[:true].read_uchar.should eql 1 + @values[:true].read_uchar.should == 1 args = @p.parse ["progname","--false"] - @values[:true].read_uchar.should eql 0 + @values[:true].read_uchar.should == 0 end it "should handle --many" do - @values[:choice].read_pointer.should eql FFI::Pointer::NULL + @values[:choice].read_pointer.should == FFI::Pointer::NULL args = @p.parse ["progname","--many=ch3"] - @values[:choice].read_pointer.read_string.should eql "ch3" + @values[:choice].read_pointer.read_string.should == "ch3" end it "should handle --count" do - @values[:count].read_int.should eql 664 + @values[:count].read_int.should == 664 args = @p.parse ["progname","--count","--count"] - @values[:count].read_int.should eql 666 + @values[:count].read_int.should == 666 end it "should handle --callback" do args = @p.parse ["progname","--callback=my_data"] diff --git a/spec/ecore_input_spec.rb b/spec/ecore_input_spec.rb index 095d11a..51f23a8 100644 --- a/spec/ecore_input_spec.rb +++ b/spec/ecore_input_spec.rb @@ -10,15 +10,15 @@ describe Efl::EcoreInput do end # it "should init" do - EcoreInput.init.should eql 1 - EcoreInput.init.should eql 2 - EcoreInput.init.should eql 3 + EcoreInput.init.should == 1 + EcoreInput.init.should == 2 + EcoreInput.init.should == 3 end # it "should shutdown" do - EcoreInput.shutdown.should eql 2 - EcoreInput.shutdown.should eql 1 - EcoreInput.shutdown.should eql 0 + EcoreInput.shutdown.should == 2 + EcoreInput.shutdown.should == 1 + EcoreInput.shutdown.should == 0 end # end 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 diff --git a/spec/edje_spec.rb b/spec/edje_spec.rb index 0dfc38b..56cb7c0 100644 --- a/spec/edje_spec.rb +++ b/spec/edje_spec.rb @@ -8,15 +8,15 @@ describe Efl::Edje do before(:all) { Edje = Efl::Edje } # it "should init" do - Edje.init.should eql 1 - Edje.init.should eql 2 - Edje.init.should eql 3 + Edje.init.should == 1 + Edje.init.should == 2 + Edje.init.should == 3 end # it "should shutdown" do - Edje.shutdown.should eql 2 - Edje.shutdown.should eql 1 - Edje.shutdown.should eql 0 + Edje.shutdown.should == 2 + Edje.shutdown.should == 1 + Edje.shutdown.should == 0 end # end diff --git a/spec/eet_spec.rb b/spec/eet_spec.rb index 048799a..4d7059c 100644 --- a/spec/eet_spec.rb +++ b/spec/eet_spec.rb @@ -13,15 +13,15 @@ describe Efl::Eet do FP = '/tmp/_eet.cfg' # it "should init" do - Eet.init.should eql 1 - Eet.init.should eql 2 - Eet.init.should eql 3 + Eet.init.should == 1 + Eet.init.should == 2 + Eet.init.should == 3 end # it "should shutdown" do - Eet.shutdown.should eql 2 - Eet.shutdown.should eql 1 - Eet.shutdown.should eql 0 + Eet.shutdown.should == 2 + Eet.shutdown.should == 1 + Eet.shutdown.should == 0 end # it "should clearcache" do @@ -31,10 +31,10 @@ describe Efl::Eet do end # it "should have good enums" do - Eet.enum_type(:eet_file_mode)[:eet_file_mode_invalid].should eql -1 - Eet.enum_type(:eet_file_mode)[:eet_file_mode_read].should eql 0 - Eet.enum_type(:eet_file_mode)[:eet_file_mode_write].should eql 1 - Eet.enum_type(:eet_file_mode)[:eet_file_mode_read_write].should eql 2 + Eet.enum_type(:eet_file_mode)[:eet_file_mode_invalid].should == -1 + Eet.enum_type(:eet_file_mode)[:eet_file_mode_read].should == 0 + Eet.enum_type(:eet_file_mode)[:eet_file_mode_write].should == 1 + Eet.enum_type(:eet_file_mode)[:eet_file_mode_read_write].should == 2 end # describe Efl::Eet::REetFile do @@ -51,35 +51,35 @@ describe Efl::Eet do Eet.enum_type(:eet_file_mode).symbols.each do |m| next if m==:eet_file_mode_invalid REetFile.open FP, Eet.enum_type(:eet_file_mode)[m] do |f| - f.mode_get.should eql m + f.mode_get.should == m end end end # it "should write" do f = REetFile.open FP, :eet_file_mode_write - f.mode_get.should eql :eet_file_mode_write + f.mode_get.should == :eet_file_mode_write f.write 'config', 'test key' f.close end # it "default mode should be read" do f = REetFile.open FP - f.mode_get.should eql :eet_file_mode_read + f.mode_get.should == :eet_file_mode_read f.close end # it "should read" do f = REetFile.open FP, :eet_file_mode_read - f.mode_get.should eql :eet_file_mode_read - f.read('config').should eql 'test key' + f.mode_get.should == :eet_file_mode_read + f.read('config').should == 'test key' f.close end # it "should read/write" do f = REetFile.open FP, :eet_file_mode_read_write f.write 'configg', 'test key' - f.read('configg').should eql 'test key' + f.read('configg').should == 'test key' f.close end # @@ -91,14 +91,14 @@ describe Efl::Eet do # it "should read in block" do REetFile.open FP, :eet_file_mode_read do |f| - f.read('config2').should eql 'test--key' + f.read('config2').should == 'test--key' end end # it "should read/write in block" do REetFile.open FP, :eet_file_mode_read_write do |f| f.write 'config22', 'test--key' - f.read('config22').should eql 'test--key' + f.read('config22').should == 'test--key' end end # diff --git a/spec/eina_hash_spec.rb b/spec/eina_hash_spec.rb index 8473fd7..0376b08 100644 --- a/spec/eina_hash_spec.rb +++ b/spec/eina_hash_spec.rb @@ -1,20 +1,21 @@ #! /usr/bin/env ruby # -*- coding: UTF-8 -*- # +require 'efl' require 'efl/eina_hash' # describe Efl::EinaHash do # before(:all) { REinaHash = Efl::EinaHash::REinaHash - Efl::Eina.init.should eql 1 + Efl::Eina.init.should == 1 @d0 = FFI::MemoryPointer.from_string "D0" @d1 = FFI::MemoryPointer.from_string "D1" @d2 = FFI::MemoryPointer.from_string "D2" @d3 = FFI::MemoryPointer.from_string "D3" } after(:all) { - Efl::Eina.shutdown.should eql 0 + Efl::Eina.shutdown.should == 0 } # it "should append prepend and fetch" do @@ -23,16 +24,16 @@ describe Efl::EinaHash do h.add 'k1', @d1 h['k3']=@d3 h['k0']=@d0 - h['k0'].read_string.should eql "D0" - h['k1'].read_string.should eql "D1" - h['k2'].read_string.should eql "D2" - h['k3'].read_string.should eql "D3" + h['k0'].read_string.should == "D0" + h['k1'].read_string.should == "D1" + h['k2'].read_string.should == "D2" + h['k3'].read_string.should == "D3" cpt=0 h.each { |k,v| cpt+=1 v.read_string.empty?.should be_false } - cpt.should eql 4 + cpt.should == 4 end # it "should be able to convert into ruby Hash from NULL pointer" do @@ -63,28 +64,28 @@ describe Efl::EinaHash do h.add 'k1', d1 h['k3']=d3 h["k0"]=d0 - h["k0"].read_string.should eql "D0" - h['k1'].read_string.should eql "D1" - h['k2'].read_string.should eql "D2" - h['k3'].read_string.should eql "D3" + h["k0"].read_string.should == "D0" + h['k1'].read_string.should == "D1" + h['k2'].read_string.should == "D2" + h['k3'].read_string.should == "D3" cpt=0 h.each { |k,v| cpt+=1 v.read_string.empty?.should be_false true } - cpt.should eql 4 + cpt.should == 4 rh = Hash.from_eina_hash h - rh.length.should eql 4 + rh.length.should == 4 rh2 = {} rh.each { |k,v| rh2[k.read_string]=v.read_string true } - rh2['k0'].should eql 'D0' - rh2['k1'].should eql 'D1' - rh2['k2'].should eql 'D2' - rh2['k3'].should eql 'D3' + rh2['k0'].should == 'D0' + rh2['k1'].should == 'D1' + rh2['k2'].should == 'D2' + rh2['k3'].should == 'D3' end # it "should be able to convert into ruby Hash from non empty REinaHash pointer" do @@ -97,12 +98,12 @@ describe Efl::EinaHash do h.add 'k1', d1 h['k3']=d3 h['k0']=d0 - h['k0'].read_string.should eql "D0" - h['k1'].read_string.should eql "D1" - h['k2'].read_string.should eql "D2" - h['k3'].read_string.should eql "D3" + h['k0'].read_string.should == "D0" + h['k1'].read_string.should == "D1" + h['k2'].read_string.should == "D2" + h['k3'].read_string.should == "D3" rh = Hash.from_eina_hash h.to_ptr - rh.length.should eql 4 + rh.length.should == 4 end # it "should be able to convert into ruby Hash from non empty REinaHash pointer, with key from string" do @@ -115,16 +116,16 @@ describe Efl::EinaHash do h.add 'k1', d1 h['k3']=d3 h['k0']=d0 - h['k0'].read_string.should eql "D0" - h['k1'].read_string.should eql "D1" - h['k2'].read_string.should eql "D2" - h['k3'].read_string.should eql "D3" + h['k0'].read_string.should == "D0" + h['k1'].read_string.should == "D1" + h['k2'].read_string.should == "D2" + h['k3'].read_string.should == "D3" rh = h.to_h_conv - rh.length.should eql 4 - rh['k0'].read_string.should eql "D0" - rh['k1'].read_string.should eql "D1" - rh['k2'].read_string.should eql "D2" - rh['k3'].read_string.should eql "D3" + rh.length.should == 4 + rh['k0'].read_string.should == "D0" + rh['k1'].read_string.should == "D1" + rh['k2'].read_string.should == "D2" + rh['k3'].read_string.should == "D3" end # it "should be able to convert into ruby Hash from non empty REinaHash pointer, with key from string block" do @@ -137,18 +138,18 @@ describe Efl::EinaHash do h.add 'k1', d1 h['k3']=d3 h['k0']=d0 - h['k0'].read_string.should eql "D0" - h['k1'].read_string.should eql "D1" - h['k2'].read_string.should eql "D2" - h['k3'].read_string.should eql "D3" + h['k0'].read_string.should == "D0" + h['k1'].read_string.should == "D1" + h['k2'].read_string.should == "D2" + h['k3'].read_string.should == "D3" cpt=0 rh = h.to_h_conv { |k| cpt+=1; k.read_string } - cpt.should eql 4 - rh.length.should eql 4 - rh['k0'].read_string.should eql "D0" - rh['k1'].read_string.should eql "D1" - rh['k2'].read_string.should eql "D2" - rh['k3'].read_string.should eql "D3" + cpt.should == 4 + rh.length.should == 4 + rh['k0'].read_string.should == "D0" + rh['k1'].read_string.should == "D1" + rh['k2'].read_string.should == "D2" + rh['k3'].read_string.should == "D3" end # it "should be able to build from ruby Hash" do @@ -166,15 +167,15 @@ describe Efl::EinaHash do rh[k2]=d2 rh[k3]=d3 h = REinaHash.new rh - h[k0].read_string.should eql "D0" - h[k1].read_string.should eql "D1" - h[k2].read_string.should eql "D2" - h[k3].read_string.should eql "D3" + h[k0].read_string.should == "D0" + h[k1].read_string.should == "D1" + h[k2].read_string.should == "D2" + h[k3].read_string.should == "D3" end # it "alternate constructor should work" do cstr_cnt = 0 h = REinaHash.new { cstr_cnt+=1; Efl::EinaHash.eina_hash_string_superfast_new FFI::Pointer::NULL } - cstr_cnt.should eql 1 + cstr_cnt.should == 1 end end diff --git a/spec/eina_list_spec.rb b/spec/eina_list_spec.rb index 74f89c5..66e65c8 100644 --- a/spec/eina_list_spec.rb +++ b/spec/eina_list_spec.rb @@ -8,10 +8,10 @@ describe Efl::EinaList do # before(:all) { REinaList = Efl::EinaList::REinaList - Efl::Eina.init.should eql 1 + Efl::Eina.init.should == 1 } after(:all) { - Efl::Eina.shutdown.should eql 0 + Efl::Eina.shutdown.should == 0 } # it "should append prepend and fetch" do @@ -25,7 +25,7 @@ describe Efl::EinaList do l << d4 l.unshift d1 0.upto 3 do |i| - l.nth(i).read_string.should eql "D#{i}" + l.nth(i).read_string.should == "D#{i}" end l.each { |p| p.read_string.empty?.should be_false } l.free @@ -60,9 +60,9 @@ describe Efl::EinaList do l << d4 l.unshift d1 ary = Array.from_eina_list l - ary.length.should eql 4 + ary.length.should == 4 0.upto 3 do |i| - ary[i].read_string.should eql "D#{i}" + ary[i].read_string.should == "D#{i}" end l.free end @@ -78,9 +78,9 @@ describe Efl::EinaList do l << d4 l.unshift d1 ary = Array.from_eina_list l.to_ptr - ary.length.should eql 4 + ary.length.should == 4 0.upto 3 do |i| - ary[i].read_string.should eql "D#{i}" + ary[i].read_string.should == "D#{i}" end l.free end @@ -93,7 +93,7 @@ describe Efl::EinaList do a << ::FFI::MemoryPointer.from_string("D3") l = REinaList.new a 0.upto 3 do |i| - l.nth(i).read_string.should eql "D#{i}" + l.nth(i).read_string.should == "D#{i}" end l.free end diff --git a/spec/eina_spec.rb b/spec/eina_spec.rb index e76129a..b16a0cb 100644 --- a/spec/eina_spec.rb +++ b/spec/eina_spec.rb @@ -6,15 +6,15 @@ require 'efl/eina' describe Efl::Eina do # it "should init" do - Efl::Eina.init.should eql 1 - Efl::Eina.init.should eql 2 - Efl::Eina.init.should eql 3 + Efl::Eina.init.should == 1 + Efl::Eina.init.should == 2 + Efl::Eina.init.should == 3 end # it "should shutdown" do - Efl::Eina.shutdown.should eql 2 - Efl::Eina.shutdown.should eql 1 - Efl::Eina.shutdown.should eql 0 + Efl::Eina.shutdown.should == 2 + Efl::Eina.shutdown.should == 1 + Efl::Eina.shutdown.should == 0 end # end diff --git a/spec/evas_spec.rb b/spec/evas_spec.rb index 90678fc..529784a 100644 --- a/spec/evas_spec.rb +++ b/spec/evas_spec.rb @@ -8,47 +8,47 @@ describe Efl::Evas do before(:all) { Evas = Efl::Evas } # it "should init" do - Evas.init.should eql 1 - Evas.init.should eql 2 - Evas.init.should eql 3 + Evas.init.should == 1 + Evas.init.should == 2 + Evas.init.should == 3 end # it "should shutdown" do - Evas.shutdown.should eql 2 - Evas.shutdown.should eql 1 - Evas.shutdown.should eql 0 + Evas.shutdown.should == 2 + Evas.shutdown.should == 1 + Evas.shutdown.should == 0 end # it "evas alloc error enum is ok" do - Efl::Evas.enum_value(:evas_alloc_error_none).should eql 0 - Efl::Evas.enum_value(:evas_alloc_error_fatal).should eql 1 - Efl::Evas.enum_value(:evas_alloc_error_recovered).should eql 2 - Efl::Evas.enum_type(:evas_alloc_error)[0].should eql :evas_alloc_error_none - Efl::Evas.enum_type(:evas_alloc_error)[1].should eql :evas_alloc_error_fatal - Efl::Evas.enum_type(:evas_alloc_error)[2].should eql :evas_alloc_error_recovered - Efl::Evas.enum_type(:evas_alloc_error)[:evas_alloc_error_none].should eql 0 - Efl::Evas.enum_type(:evas_alloc_error)[:evas_alloc_error_fatal].should eql 1 - Efl::Evas.enum_type(:evas_alloc_error)[:evas_alloc_error_recovered].should eql 2 + Efl::Evas.enum_value(:evas_alloc_error_none).should == 0 + Efl::Evas.enum_value(:evas_alloc_error_fatal).should == 1 + Efl::Evas.enum_value(:evas_alloc_error_recovered).should == 2 + Efl::Evas.enum_type(:evas_alloc_error)[0].should == :evas_alloc_error_none + Efl::Evas.enum_type(:evas_alloc_error)[1].should == :evas_alloc_error_fatal + Efl::Evas.enum_type(:evas_alloc_error)[2].should == :evas_alloc_error_recovered + Efl::Evas.enum_type(:evas_alloc_error)[:evas_alloc_error_none].should == 0 + Efl::Evas.enum_type(:evas_alloc_error)[:evas_alloc_error_fatal].should == 1 + Efl::Evas.enum_type(:evas_alloc_error)[:evas_alloc_error_recovered].should == 2 end # it "should have no memory allocation error occured" do Evas.init - Evas.alloc_error.should eql :evas_alloc_error_none + Evas.alloc_error.should == :evas_alloc_error_none Evas.shutdown end # it "should process async events" do cb = Proc.new do |target,type,evt| - target.read_string.should eql "target" - type.should eql :evas_callback_show - evt.read_string.should eql "work" + target.read_string.should == "target" + type.should == :evas_callback_show + evt.read_string.should == "work" end Evas.init target = FFI::MemoryPointer.from_string("target") work = FFI::MemoryPointer.from_string("work") Evas.async_events_put target, :evas_callback_show, work, cb - Evas.async_events_process.should eql 1 - Evas.async_events_process.should eql 0 + Evas.async_events_process.should == 1 + Evas.async_events_process.should == 0 Evas.shutdown end # @@ -79,12 +79,12 @@ describe Efl::Evas do end it "should be able to create and destroy evas" do e1 = Evas::REvas.new - e1.address.should_not eql 0 + e1.address.should_not == 0 e2 = Evas::REvas.new e1 - e1.address.should eql e2.address + e1.address.should == e2.address e3 = Evas::REvas.new e1.to_ptr - e1.address.should eql e3.address - e2.address.should eql e3.address + e1.address.should == e3.address + e2.address.should == e3.address (e1==e2).should be_false (e2==e3).should be_false (e1==e3).should be_false @@ -94,11 +94,11 @@ describe Efl::Evas do e1.free e1.to_ptr.should be_nil e4 = Evas::REvas.new Evas.evas_new - e4.address.should_not eql 0 + e4.address.should_not == 0 e5 = e4.dup - e4.address.should eql e5.address + e4.address.should == e5.address e6 = e4.clone - e4.address.should eql e6.address + e4.address.should == e6.address e4.free e4.to_ptr.should be_nil end @@ -128,7 +128,7 @@ describe Efl::Evas do it "attach data should work" do data = FFI::MemoryPointer.from_string "my data" @e.data_attach_set data - @e.data_attach_get.read_string.should eql "my data" + @e.data_attach_get.read_string.should == "my data" end # it "should not crash" do @@ -143,7 +143,7 @@ describe Efl::Evas do @e.render_dump end it "output method should work" do - @e.output_method_get.should eql Evas::render_method_lookup("buffer") + @e.output_method_get.should == Evas::render_method_lookup("buffer") # output_method_set tested in before(:all) l = Efl::Evas::render_method_list Evas::render_method_list_free l @@ -156,11 +156,11 @@ describe Efl::Evas do # it "output size should work" do @e.output_size_set 69, 666 - @e.output_size_get.should eql [69,666] + @e.output_size_get.should == [69,666] end it "output viewport should work" do @e.output_viewport_set 0, 0, 666, 69 - @e.output_viewport_get.should eql [0,0,666,69] + @e.output_viewport_get.should == [0,0,666,69] end # it "coordinates evas<=>world should work" do @@ -176,26 +176,26 @@ describe Efl::Evas do end # it "freeze and thaw should work" do - @e.event_freeze_get.should eql 0 + @e.event_freeze_get.should == 0 @e.event_freeze - @e.event_freeze_get.should eql 1 + @e.event_freeze_get.should == 1 @e.event_thaw - @e.event_freeze_get.should eql 0 + @e.event_freeze_get.should == 0 end # it "up/down mouse event should work" do @e.event_feed_mouse_down 2, :evas_button_double_click, Time.now.to_i, FFI::Pointer::NULL - @e.pointer_button_down_mask_get.should eql 2 + @e.pointer_button_down_mask_get.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 eql 0 + @e.pointer_button_down_mask_get.should == 0 end # it "move mouse event should work" do - @e.pointer_output_xy_get.should eql [0,0] - @e.pointer_canvas_xy_get.should eql [0,0] + @e.pointer_output_xy_get.should == [0,0] + @e.pointer_canvas_xy_get.should == [0,0] @e.event_feed_mouse_move 6, 6, Time.now.to_i, FFI::Pointer::NULL - @e.pointer_output_xy_get.should eql [6,6] - @e.pointer_canvas_xy_get.should eql [6,6] + @e.pointer_output_xy_get.should == [6,6] + @e.pointer_canvas_xy_get.should == [6,6] end # it "in/out mouse event should work" do @@ -220,8 +220,8 @@ describe Efl::Evas do @cb = false kd_cb = Proc.new do |data, e, obj, event_info| data.read_string.should eq "mouse_in" - e.address.should eql @e.address - obj.address.should eql @bg.address + e.address.should == @e.address + obj.address.should == @bg.address @db=true true end @@ -232,7 +232,7 @@ describe Efl::Evas do @bg.show @bg.event_callback_add :evas_callback_mouse_in, kd_cb, kd_d @e.event_feed_mouse_in Time.now.to_i, FFI::Pointer::NULL - @bg.event_callback_del(:evas_callback_mouse_in, kd_cb).address.should eql kd_d.address + @bg.event_callback_del(:evas_callback_mouse_in, kd_cb).address.should == kd_d.address @db.should be_true end # @@ -240,16 +240,16 @@ describe Efl::Evas do @e.image_cache_flush @e.image_cache_reload @e.image_cache_set 666 - @e.image_cache_get.should eql 666 + @e.image_cache_get.should == 666 end # it "font functions should work" do @e.font_hinting_set :evas_font_hinting_bytecode - @e.font_hinting_get.should eql :evas_font_hinting_bytecode + @e.font_hinting_get.should == :evas_font_hinting_bytecode @e.font_hinting_can_hint(:evas_font_hinting_none).should be_true @e.font_cache_flush @e.font_cache_set 666 - @e.font_cache_get.should eql 666 + @e.font_cache_get.should == 666 l = @e.font_available_list @e.font_available_list_free l @e.font_path_clear @@ -258,7 +258,7 @@ describe Efl::Evas do @e.font_path_prepend a[0] require 'efl/eina_list' Efl::EinaList::REinaList.new(@e.font_path_list).each_with_index do |p,i| - p.read_string.should eql a[i] + p.read_string.should == a[i] end end end @@ -300,11 +300,11 @@ describe Efl::Evas do clipper.resize 50, 50 @o.clip = clipper.to_ptr clipper.show - @o.clip_get.address.should eql clipper.address + @o.clip_get.address.should == clipper.address require 'efl/eina_list' - Efl::EinaList::REinaList.new(clipper.clipees_get).to_ary[0].address.should eql @o.address + Efl::EinaList::REinaList.new(clipper.clipees_get).to_ary[0].address.should == @o.address @o.clip_unset - @o.clip_get.address.should eql 0 + @o.clip_get.address.should == 0 end # @@ -317,25 +317,25 @@ describe Efl::Evas do end # it "layer functions should work" do - @o.layer_get.should eql 0 + @o.layer_get.should == 0 @o.layer_set 2 - @o.layer_get.should eql 2 + @o.layer_get.should == 2 @o.layer = 0 - @o.layer_get.should eql 0 + @o.layer_get.should == 0 end # it "name functions should work" do @o.name_set "My name" - @o.name_get.should eql "My name" + @o.name_get.should == "My name" end # it "geometry functions should work" do # FIXME -# @o.geometry_get.should eql [0,0,100,100] +# @o.geometry_get.should == [0,0,100,100] # @o.resize 50,50 -# @o.geometry_get.should eql [0,0,50,50] +# @o.geometry_get.should == [0,0,50,50] # @o.move 10, 10 -# @o.geometry_get.should eql [10,10,50,50] +# @o.geometry_get.should == [10,10,50,50] end # it "show hide visible should work" do |