summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-04-11 23:04:48 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-04-11 23:04:48 +0200
commit9c39aee51c91457ee9177fabca8a6689a8d8d05a (patch)
treee32ffb54a178204847cf338ba765081bc8f803f4 /spec
parent455dd7ecbbe137fef1ff5507055541350a924382 (diff)
downloadffi-efl-9c39aee51c91457ee9177fabca8a6689a8d8d05a.zip
ffi-efl-9c39aee51c91457ee9177fabca8a6689a8d8d05a.tar.gz
update eet spec
Diffstat (limited to 'spec')
-rw-r--r--spec/eet_spec.rb41
1 files changed, 29 insertions, 12 deletions
diff --git a/spec/eet_spec.rb b/spec/eet_spec.rb
index dd0c0d5..848dc78 100644
--- a/spec/eet_spec.rb
+++ b/spec/eet_spec.rb
@@ -28,52 +28,69 @@ describe EFL::EET do
end
#
it "should open and close" do
- EET.init.should eql 1
+ EET.init
f = EET.open FP, EET::FILE_MODE_WRITE
f.write 'fake', 'value'
f.close
- EET.shutdown.should eql 0
+ EET.shutdown
end
it "should be able to get file access mode" do
- EET.init.should eql 1
+ EET.init
[ EET::FILE_MODE_READ, EET::FILE_MODE_WRITE, EET::FILE_MODE_READ_WRITE ].each do |m|
EET.open FP, m do |f|
f.mode_get.should eql m
end
end
- EET.shutdown.should eql 0
+ EET.shutdown
end
#
it "should write" do
- EET.init.should eql 1
+ EET.init
f = EET.open FP, EET::FILE_MODE_WRITE
f.write 'config', 'test key'
f.close
- EET.shutdown.should eql 0
+ EET.shutdown
end
#
it "should read" do
- EET.init.should eql 1
+ EET.init
f = EET.open FP, EET::FILE_MODE_READ
f.read('config').should eql 'test key'
f.close
- EET.shutdown.should eql 0
+ EET.shutdown
+ end
+ #
+ it "should read/write" do
+ EET.init
+ f = EET.open FP, EET::FILE_MODE_READ_WRITE
+ f.write 'configg', 'test key'
+ f.read('configg').should eql 'test key'
+ f.close
+ EET.shutdown
end
#
it "should write in block" do
- EET.init.should eql 1
+ EET.init
EET.open FP, EET::FILE_MODE_WRITE do |f|
f.write 'config2', 'test--key'
end
- EET.shutdown.should eql 0
+ EET.shutdown
end
#
it "should read in block" do
- EET.init.should eql 1
+ EET.init
EET.open FP, EET::FILE_MODE_READ do |f|
f.read('config2').should eql 'test--key'
end
- EET.shutdown.should eql 0
+ EET.shutdown
end
#
+ it "should read/write in block" do
+ EET.init
+ EET.open FP, EET::FILE_MODE_READ_WRITE do |f|
+ f.write 'config22', 'test--key'
+ f.read('config22').should eql 'test--key'
+ end
+ EET.shutdown
+ end
end