rfusefs 0.8.0 → 1.0.0.RC0

Sign up to get free protection for your applications and to get access to all the features.
data/spec/rfusefs_spec.rb CHANGED
@@ -8,14 +8,14 @@ describe FuseFS do
8
8
 
9
9
  describe "an empty FuseFS object" do
10
10
  before(:each) do
11
- @fuse = FuseFS::RFuseFSAPI.new(Object.new())
11
+ @fuse = FuseFS::RFuseFS.new(Object.new())
12
12
  end
13
13
 
14
14
  it "should return an appropriate Stat for the root directory" do
15
- stat = @fuse.getattr(ROOT_PATH)
15
+ stat = @fuse.getattr(nil,ROOT_PATH)
16
16
  stat.should respond_to(:dev)
17
- (stat.mode & FuseFS::Stat::S_IFDIR).should_not == 0
18
- (stat.mode & FuseFS::Stat::S_IFREG).should == 0
17
+ (stat.mode & RFuse::Stat::S_IFDIR).should_not == 0
18
+ (stat.mode & RFuse::Stat::S_IFREG).should == 0
19
19
  permissions(stat.mode).should == 0555
20
20
  end
21
21
 
@@ -23,23 +23,23 @@ describe FuseFS do
23
23
  filler = mock("entries_filler")
24
24
  filler.should_receive(:push).with(".",nil,0)
25
25
  filler.should_receive(:push).with("..",nil,0)
26
- @fuse.readdir("/",filler,nil,nil)
26
+ @fuse.readdir(nil,"/",filler,nil,nil)
27
27
  end
28
28
 
29
29
  it "should raise ENOENT for other paths" do
30
- lambda { @fuse.getattr("/somepath") }.should raise_error(Errno::ENOENT)
30
+ lambda { @fuse.getattr(nil,"/somepath") }.should raise_error(Errno::ENOENT)
31
31
  end
32
32
 
33
33
  it "should not allow new files or directories" do
34
- lambda { @fuse.mknod("/afile",0100644,0) }.should raise_error(Errno::EACCES)
35
- lambda { @fuse.mkdir("/adir",0040555) }.should raise_error(Errno::EACCES)
34
+ lambda { @fuse.mknod(nil,"/afile",0100644,0,0) }.should raise_error(Errno::EACCES)
35
+ lambda { @fuse.mkdir(nil,"/adir",0040555) }.should raise_error(Errno::EACCES)
36
36
  end
37
37
  end
38
38
 
39
39
  describe "a FuseFS filesystem" do
40
40
  before(:each) do
41
- @mock_fuse = mock("FuseFS")
42
- @fuse = FuseFS::RFuseFSAPI.new(@mock_fuse)
41
+ @mock_fuse = FuseFS::FuseDir.new()
42
+ @fuse = FuseFS::RFuseFS.new(@mock_fuse)
43
43
  end
44
44
 
45
45
  describe :readdir do
@@ -52,7 +52,7 @@ describe FuseFS do
52
52
  filler.should_receive(:push).with(".",nil,0)
53
53
  filler.should_receive(:push).with("..",nil,0)
54
54
  filler.should_receive(:push).with("afile",nil,0)
55
- @fuse.readdir("/apath",filler,nil,nil)
55
+ @fuse.readdir(nil,"/apath",filler,nil,nil)
56
56
  end
57
57
 
58
58
  end
@@ -73,10 +73,10 @@ describe FuseFS do
73
73
  it "should return a Stat like object representing a directory" do
74
74
  @mock_fuse.should_receive(:can_write?).with(@checkfile).at_most(:once).and_return(false)
75
75
  @mock_fuse.should_receive(:can_mkdir?).with(@checkfile).at_most(:once).and_return(false)
76
- stat = @fuse.getattr(dir)
76
+ stat = @fuse.getattr(nil,dir)
77
77
  #Apparently find relies on nlink accurately listing the number of files/directories or nlink being 1
78
78
  stat.nlink.should == 1
79
- filetype(stat.mode).should == FuseFS::Stat::S_IFDIR
79
+ filetype(stat.mode).should == RFuse::Stat::S_IFDIR
80
80
  permissions(stat.mode).should == 0555
81
81
  end
82
82
 
@@ -84,21 +84,21 @@ describe FuseFS do
84
84
  it "should return writable mode if can_mkdir?" do
85
85
  @mock_fuse.should_receive(:can_mkdir?).with(@checkfile).at_most(:once).and_return(true)
86
86
 
87
- stat = @fuse.getattr(dir)
87
+ stat = @fuse.getattr(nil,dir)
88
88
  permissions(stat.mode).should == 0777
89
89
  end
90
90
 
91
91
  it "should return writable mode if can_write?" do
92
92
  @mock_fuse.should_receive(:can_write?).with(@checkfile).at_most(:once).and_return(true)
93
93
 
94
- stat = @fuse.getattr(dir)
94
+ stat = @fuse.getattr(nil,dir)
95
95
  permissions(stat.mode).should == 0777
96
96
 
97
97
  end
98
98
 
99
99
  it "should return times in the result if available" do
100
100
  @mock_fuse.should_receive(:times).with(dir).and_return([10,20,30])
101
- stat = @fuse.getattr(dir)
101
+ stat = @fuse.getattr(nil,dir)
102
102
  stat.atime.should == 10
103
103
  stat.mtime.should == 20
104
104
  stat.ctime.should == 30
@@ -116,40 +116,40 @@ describe FuseFS do
116
116
 
117
117
 
118
118
  it "should return a Stat like object representing a file" do
119
- stat = @fuse.getattr(@file)
120
- (stat.mode & FuseFS::Stat::S_IFDIR).should == 0
121
- (stat.mode & FuseFS::Stat::S_IFREG).should_not == 0
119
+ stat = @fuse.getattr(nil,@file)
120
+ (stat.mode & RFuse::Stat::S_IFDIR).should == 0
121
+ (stat.mode & RFuse::Stat::S_IFREG).should_not == 0
122
122
  permissions(stat.mode).should == 0444
123
123
  end
124
124
 
125
125
  it "should indicate executable mode if executable?" do
126
126
  @mock_fuse.should_receive(:executable?).with(@file).and_return(true)
127
- stat = @fuse.getattr(@file)
127
+ stat = @fuse.getattr(nil,@file)
128
128
  permissions(stat.mode).should == 0555
129
129
  end
130
130
 
131
131
  it "should indicate writable mode if can_write?" do
132
132
  @mock_fuse.should_receive(:can_write?).with(@file).and_return(true)
133
- stat = @fuse.getattr(@file)
133
+ stat = @fuse.getattr(nil,@file)
134
134
  permissions(stat.mode).should == 0666
135
135
  end
136
136
 
137
137
  it "should by 777 mode if can_write? and exectuable?" do
138
138
  @mock_fuse.should_receive(:can_write?).with(@file).and_return(true)
139
139
  @mock_fuse.should_receive(:executable?).with(@file).and_return(true)
140
- stat = @fuse.getattr(@file)
140
+ stat = @fuse.getattr(nil,@file)
141
141
  permissions(stat.mode).should == 0777
142
142
  end
143
143
 
144
144
  it "should include size in the result if available" do
145
145
  @mock_fuse.should_receive(:size).with(@file).and_return(234)
146
- stat = @fuse.getattr(@file)
146
+ stat = @fuse.getattr(nil,@file)
147
147
  stat.size.should == 234
148
148
  end
149
149
 
150
150
  it "should include times in the result if available" do
151
151
  @mock_fuse.should_receive(:times).with(@file).and_return([22,33,44])
152
- stat = @fuse.getattr(@file)
152
+ stat = @fuse.getattr(nil,@file)
153
153
  stat.atime.should == 22
154
154
  stat.mtime.should == 33
155
155
  stat.ctime.should == 44
@@ -159,7 +159,7 @@ describe FuseFS do
159
159
  it "should raise ENOENT for a path that does not exist" do
160
160
  @mock_fuse.should_receive(:file?).with(TEST_FILE).and_return(false)
161
161
  @mock_fuse.should_receive(:directory?).with(TEST_FILE).and_return(false)
162
- lambda{stat = @fuse.getattr(TEST_FILE) }.should raise_error(Errno::ENOENT)
162
+ lambda{stat = @fuse.getattr(nil,TEST_FILE) }.should raise_error(Errno::ENOENT)
163
163
  end
164
164
  end
165
165
 
@@ -169,37 +169,37 @@ describe FuseFS do
169
169
  @mock_fuse.stub!(:file?).with(TEST_FILE).and_return(false)
170
170
  @mock_fuse.stub!(:directory?).with(TEST_FILE).and_return(false)
171
171
  @mock_fuse.should_receive(:can_write?).with(TEST_FILE).and_return(false)
172
- lambda{@fuse.mknod(TEST_FILE,0100644,nil)}.should raise_error(Errno::EACCES)
172
+ lambda{@fuse.mknod(nil,TEST_FILE,0100644,0,0)}.should raise_error(Errno::EACCES)
173
173
  end
174
174
 
175
175
  it ":mkdir should raise EACCES unless :can_mkdir?" do
176
176
  @mock_fuse.stub!(:file?).with(TEST_FILE).and_return(false)
177
177
  @mock_fuse.stub!(:directory?).with(TEST_FILE).and_return(false)
178
178
  @mock_fuse.should_receive(:can_mkdir?).with(TEST_FILE).and_return(false)
179
- lambda{@fuse.mkdir(TEST_FILE,004555)}.should raise_error(Errno::EACCES)
179
+ lambda{@fuse.mkdir(nil,TEST_FILE,004555)}.should raise_error(Errno::EACCES)
180
180
  end
181
181
 
182
182
  it ":mknod should raise EACCES unless mode requests a regular file" do
183
183
  @mock_fuse.stub!(:file?).with(TEST_FILE).and_return(false)
184
184
  @mock_fuse.stub!(:directory?).with(TEST_FILE).and_return(false)
185
185
  @mock_fuse.stub!(:can_write?).with(TEST_FILE).and_return(true)
186
- lambda{@fuse.mknod(TEST_FILE,FuseFS::Stat::S_IFLNK | 0644,nil)}.should raise_error(Errno::EACCES)
186
+ lambda{@fuse.mknod(nil,TEST_FILE,RFuse::Stat::S_IFLNK | 0644,0,0)}.should raise_error(Errno::EACCES)
187
187
  end
188
188
 
189
189
  it ":mknod should result in getattr returning a Stat like object representing an empty file" do
190
190
  @mock_fuse.stub!(:file?).with(TEST_FILE).and_return(false)
191
191
  @mock_fuse.stub!(:directory?).with(TEST_FILE).and_return(false)
192
192
  @mock_fuse.stub!(:can_write?).with(TEST_FILE).and_return(true)
193
- @fuse.mknod(TEST_FILE,FuseFS::Stat::S_IFREG | 0644,nil)
193
+ @fuse.mknod(nil,TEST_FILE,RFuse::Stat::S_IFREG | 0644,0,0)
194
194
 
195
- stat = @fuse.getattr(TEST_FILE)
196
- filetype(stat.mode).should == FuseFS::Stat::S_IFREG
195
+ stat = @fuse.getattr(nil,TEST_FILE)
196
+ filetype(stat.mode).should == RFuse::Stat::S_IFREG
197
197
  stat.size.should == 0
198
198
  end
199
199
 
200
200
  it ":mkdir should not raise error if can_mkdir?" do
201
201
  @mock_fuse.should_receive(:can_mkdir?).with(TEST_FILE).and_return(true)
202
- @fuse.mkdir(TEST_FILE,004555)
202
+ @fuse.mkdir(nil,TEST_FILE,004555)
203
203
  end
204
204
 
205
205
  end
@@ -210,13 +210,13 @@ describe FuseFS do
210
210
  ffi.flags = Fcntl::O_RDONLY
211
211
  @mock_fuse.stub!(:file?).with(TEST_FILE).and_return(true)
212
212
  @mock_fuse.stub!(:read_file).with(TEST_FILE).and_return("Hello World\n")
213
- @fuse.open(TEST_FILE,ffi)
213
+ @fuse.open(nil,TEST_FILE,ffi)
214
214
  #to me fuse is backwards -- size, offset!
215
- @fuse.read(TEST_FILE,5,0,ffi).should == "Hello"
216
- @fuse.read(TEST_FILE,4,6,ffi).should == "Worl"
217
- @fuse.read(TEST_FILE,10,8,ffi).should == "rld\n"
218
- @fuse.flush(TEST_FILE,ffi)
219
- @fuse.release(TEST_FILE,ffi)
215
+ @fuse.read(nil,TEST_FILE,5,0,ffi).should == "Hello"
216
+ @fuse.read(nil,TEST_FILE,4,6,ffi).should == "Worl"
217
+ @fuse.read(nil,TEST_FILE,10,8,ffi).should == "rld\n"
218
+ @fuse.flush(nil,TEST_FILE,ffi)
219
+ @fuse.release(nil,TEST_FILE,ffi)
220
220
  end
221
221
  end
222
222
 
@@ -227,15 +227,15 @@ describe FuseFS do
227
227
  @mock_fuse.stub!(:can_write?).with(TEST_FILE).and_return(true)
228
228
  @mock_fuse.stub!(:read_file).with(TEST_FILE).and_return("I'm writing a file\n")
229
229
  @mock_fuse.should_receive(:write_to).once().with(TEST_FILE,"My new contents\n")
230
- @fuse.open(TEST_FILE,ffi)
231
- @fuse.ftruncate(TEST_FILE,0,ffi)
232
- @fuse.write(TEST_FILE,"My new c",0,ffi)
233
- @fuse.write(TEST_FILE,"ontents\n",8,ffi)
234
- @fuse.flush(TEST_FILE,ffi)
230
+ @fuse.open(nil,TEST_FILE,ffi)
231
+ @fuse.ftruncate(nil,TEST_FILE,0,ffi)
232
+ @fuse.write(nil,TEST_FILE,"My new c",0,ffi)
233
+ @fuse.write(nil,TEST_FILE,"ontents\n",8,ffi)
234
+ @fuse.flush(nil,TEST_FILE,ffi)
235
235
  #that's right flush can be called more than once.
236
- @fuse.flush(TEST_FILE,ffi)
236
+ @fuse.flush(nil,TEST_FILE,ffi)
237
237
  #but then we can write some more and flush again
238
- @fuse.release(TEST_FILE,ffi)
238
+ @fuse.release(nil,TEST_FILE,ffi)
239
239
  end
240
240
 
241
241
  it "should append to a file opened WR_ONLY | APPEND" do
@@ -244,13 +244,13 @@ describe FuseFS do
244
244
  @mock_fuse.stub!(:can_write?).with(TEST_FILE).and_return(true)
245
245
  @mock_fuse.stub!(:read_file).with(TEST_FILE).and_return("I'm writing a file\n")
246
246
  @mock_fuse.should_receive(:write_to).once().with(TEST_FILE,"I'm writing a file\nMy new contents\n")
247
- @fuse.open(TEST_FILE,ffi)
248
- @fuse.write(TEST_FILE,"My new c",0,ffi)
249
- @fuse.write(TEST_FILE,"ontents\n",8,ffi)
250
- @fuse.flush(TEST_FILE,ffi)
247
+ @fuse.open(nil,TEST_FILE,ffi)
248
+ @fuse.write(nil,TEST_FILE,"My new c",0,ffi)
249
+ @fuse.write(nil,TEST_FILE,"ontents\n",8,ffi)
250
+ @fuse.flush(nil,TEST_FILE,ffi)
251
251
  #that's right flush can be called more than once. But we should only write-to the first time
252
- @fuse.flush(TEST_FILE,ffi)
253
- @fuse.release(TEST_FILE,ffi)
252
+ @fuse.flush(nil,TEST_FILE,ffi)
253
+ @fuse.release(nil,TEST_FILE,ffi)
254
254
 
255
255
  end
256
256
 
@@ -267,11 +267,11 @@ describe FuseFS do
267
267
  @mock_fuse.should_receive(:raw_read).with(TEST_FILE,5,0,"raw").and_return("12345")
268
268
  @mock_fuse.should_receive(:raw_read).with(TEST_FILE,5,5,"raw").and_return("67890")
269
269
  @mock_fuse.should_receive(:raw_close).with(TEST_FILE,"raw")
270
- @fuse.open(TEST_FILE,ffi)
271
- @fuse.read(TEST_FILE,0,5,ffi).should == "12345"
272
- @fuse.read(TEST_FILE,5,5,ffi).should == "67890"
273
- @fuse.flush(TEST_FILE,ffi)
274
- @fuse.release(TEST_FILE,ffi)
270
+ @fuse.open(nil,TEST_FILE,ffi)
271
+ @fuse.read(nil,TEST_FILE,0,5,ffi).should == "12345"
272
+ @fuse.read(nil,TEST_FILE,5,5,ffi).should == "67890"
273
+ @fuse.flush(nil,TEST_FILE,ffi)
274
+ @fuse.release(nil,TEST_FILE,ffi)
275
275
  end
276
276
 
277
277
  end
@@ -287,12 +287,12 @@ describe FuseFS do
287
287
  @mock_fuse.should_receive(:raw_write).with(TEST_FILE,0,5,"12345",raw).once().and_return(5)
288
288
  @mock_fuse.should_receive(:raw_write).with(TEST_FILE,5,5,"67890",raw).once().and_return(5)
289
289
  @mock_fuse.should_receive(:raw_close).with(TEST_FILE,raw)
290
- @fuse.open(TEST_FILE,ffi)
291
- @fuse.ftruncate(TEST_FILE,0,ffi)
292
- @fuse.write(TEST_FILE,"12345",0,ffi).should == 5
293
- @fuse.write(TEST_FILE,"67890",5,ffi).should == 5
294
- @fuse.flush(TEST_FILE,ffi)
295
- @fuse.release(TEST_FILE,ffi)
290
+ @fuse.open(nil,TEST_FILE,ffi)
291
+ @fuse.ftruncate(nil,TEST_FILE,0,ffi)
292
+ @fuse.write(nil,TEST_FILE,"12345",0,ffi).should == 5
293
+ @fuse.write(nil,TEST_FILE,"67890",5,ffi).should == 5
294
+ @fuse.flush(nil,TEST_FILE,ffi)
295
+ @fuse.release(nil,TEST_FILE,ffi)
296
296
  end
297
297
 
298
298
  it "should pass 'wa' to raw_open if fuse sends WRONLY | APPEND" do
@@ -301,20 +301,20 @@ describe FuseFS do
301
301
  raw = Object.new()
302
302
  @mock_fuse.stub!(:can_write?).with(TEST_FILE).and_return(true)
303
303
  @mock_fuse.should_receive(:raw_open).with(TEST_FILE,"wa",true).and_return(raw)
304
- @fuse.open(TEST_FILE,ffi)
304
+ @fuse.open(nil,TEST_FILE,ffi)
305
305
  end
306
306
  end
307
307
 
308
308
  context "deleting files" do
309
309
  it "should raise EACCES unless :can_delete?" do
310
310
  @mock_fuse.should_receive(:can_delete?).with(TEST_FILE).and_return(false)
311
- lambda {@fuse.unlink(TEST_FILE)}.should raise_error(Errno::EACCES)
311
+ lambda {@fuse.unlink(nil,TEST_FILE)}.should raise_error(Errno::EACCES)
312
312
  end
313
313
 
314
314
  it "should :delete without error if :can_delete?" do
315
315
  @mock_fuse.stub!(:can_delete?).with(TEST_FILE).and_return(true)
316
316
  @mock_fuse.should_receive(:delete).with(TEST_FILE)
317
- @fuse.unlink(TEST_FILE)
317
+ @fuse.unlink(nil,TEST_FILE)
318
318
  end
319
319
 
320
320
  it "should remove entries created with mknod that have never been opened" do
@@ -322,28 +322,29 @@ describe FuseFS do
322
322
  @mock_fuse.stub!(:directory?).with(TEST_FILE).and_return(false)
323
323
  @mock_fuse.stub!(:can_delete?).with(TEST_FILE).and_return(true)
324
324
  @mock_fuse.stub!(:can_write?).with(TEST_FILE).and_return(true)
325
- @fuse.mknod(TEST_FILE,FuseFS::Stat::S_IFREG | 0644,nil)
326
- @fuse.unlink(TEST_FILE)
327
- lambda {@fuse.getattr(TEST_FILE)}.should raise_error(Errno::ENOENT)
325
+ @fuse.mknod(nil,TEST_FILE,RFuse::Stat::S_IFREG | 0644,0,0)
326
+
327
+ @fuse.unlink(nil,TEST_FILE)
328
+ lambda {@fuse.getattr(nil,TEST_FILE)}.should raise_error(Errno::ENOENT)
328
329
  end
329
330
  end
330
331
 
331
332
  context "deleting directories" do
332
333
  it "should raise EACCES unless :can_rmdir?" do
333
334
  @mock_fuse.should_receive(:can_rmdir?).with(TEST_DIR).and_return(false)
334
- lambda{@fuse.rmdir(TEST_DIR)}.should raise_error(Errno::EACCES)
335
+ lambda{@fuse.rmdir(nil,TEST_DIR)}.should raise_error(Errno::EACCES)
335
336
  end
336
337
 
337
338
  it "should :rmdir without error if :can_rmdir?" do
338
339
  @mock_fuse.stub!(:can_rmdir?).with(TEST_DIR).and_return(true)
339
- @fuse.rmdir(TEST_DIR)
340
+ @fuse.rmdir(nil,TEST_DIR)
340
341
  end
341
342
  end
342
343
 
343
344
  context "touching files" do
344
345
  it "should call :touch in response to utime" do
345
346
  @mock_fuse.should_receive(:touch).with(TEST_FILE,220)
346
- @fuse.utime(TEST_FILE,100,220)
347
+ @fuse.utime(nil,TEST_FILE,100,220)
347
348
  end
348
349
  end
349
350
 
@@ -357,13 +358,13 @@ describe FuseFS do
357
358
  it "should raise EACCES unless :can_write? the new file" do
358
359
  @mock_fuse.stub!(:can_delete?).with(@oldfile).and_return(true)
359
360
  @mock_fuse.should_receive(:can_write?).with(@newfile).and_return(false)
360
- lambda {@fuse.rename(@oldfile,@newfile)}.should raise_error(Errno::EACCES)
361
+ lambda {@fuse.rename(nil,@oldfile,@newfile)}.should raise_error(Errno::EACCES)
361
362
  end
362
363
 
363
364
  it "should raise EACCES unless :can_delete the old file" do
364
365
  @mock_fuse.stub!(:can_write?).with(@newfile).and_return(true)
365
366
  @mock_fuse.should_receive(:can_delete?).with(@oldfile).and_return(false)
366
- lambda {@fuse.rename(@oldfile,@newfile)}.should raise_error(Errno::EACCES)
367
+ lambda {@fuse.rename(nil,@oldfile,@newfile)}.should raise_error(Errno::EACCES)
367
368
  end
368
369
 
369
370
  it "should copy and delete files" do
@@ -372,12 +373,12 @@ describe FuseFS do
372
373
  @mock_fuse.should_receive(:read_file).with(@oldfile).and_return("some contents\n")
373
374
  @mock_fuse.should_receive(:write_to).with(@newfile,"some contents\n")
374
375
  @mock_fuse.should_receive(:delete).with(@oldfile)
375
- @fuse.rename(@oldfile,@newfile)
376
+ @fuse.rename(nil,@oldfile,@newfile)
376
377
  end
377
378
 
378
379
  it "should not copy and delete files if fs responds_to? :rename" do
379
380
  @mock_fuse.should_receive(:rename).with(@oldfile,@newfile).and_return(true)
380
- @fuse.rename(@oldfile,@newfile)
381
+ @fuse.rename(nil,@oldfile,@newfile)
381
382
  end
382
383
 
383
384
  it "should raise EACCES if moving a directory and rename not supported" do
@@ -385,7 +386,7 @@ describe FuseFS do
385
386
  @mock_fuse.stub!(:directory?).with(@oldfile).and_return(true)
386
387
  @mock_fuse.stub!(:can_write?).with(@newfile).and_return(true)
387
388
  @mock_fuse.stub!(:can_delete?).with(@oldfile).and_return(true)
388
- lambda{@fuse.rename(@oldfile,@newfile)}.should raise_error(Errno::EACCES)
389
+ lambda{@fuse.rename(nil,@oldfile,@newfile)}.should raise_error(Errno::EACCES)
389
390
  end
390
391
 
391
392
  end
data/spec/sample_spec.rb CHANGED
@@ -1,7 +1,8 @@
1
+ require 'spec_helper'
1
2
  require 'rfusefs'
2
3
  require 'tmpdir'
3
4
  require 'pathname'
4
- require 'samples/hello'
5
+ require 'hello'
5
6
 
6
7
  describe "Access Hello World sample from Ruby file operations" do
7
8
  before(:all) do
@@ -10,7 +11,7 @@ describe "Access Hello World sample from Ruby file operations" do
10
11
  @mountpoint = tmpdir + "sample_spec"
11
12
  @mountpoint.mkdir unless @mountpoint.directory?
12
13
  hello = HelloDir.new()
13
- FuseFS.mount(@mountpoint,hello)
14
+ FuseFS.mount(hello,@mountpoint)
14
15
  #Give FUSE some time to get started
15
16
  sleep(1)
16
17
  end
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,9 @@
1
+ SPEC_DIR = File.dirname(__FILE__)
2
+ lib_path = File.expand_path("#{SPEC_DIR}/../samples")
3
+ puts lib_path
4
+ $LOAD_PATH.unshift lib_path unless $LOAD_PATH.include?(lib_path)
5
+
6
+
1
7
  require 'rfusefs'
2
8
  require 'fusefs/metadir'
3
9
  require 'fcntl'
@@ -16,7 +22,7 @@ module RFuseFSHelper
16
22
  end
17
23
 
18
24
  def filetype(mode)
19
- return (mode & FuseFS::Stat::S_IFMT)
25
+ return (mode & RFuse::Stat::S_IFMT)
20
26
  end
21
27
 
22
28
  FuseContext = Struct.new(:uid,:gid)