File: virtual_file_spec.rb

package info (click to toggle)
ruby-extlib 0.9.16-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 576 kB
  • sloc: ruby: 7,014; makefile: 5
file content (22 lines) | stat: -rw-r--r-- 500 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'spec_helper'
require 'extlib/virtual_file'

describe VirtualFile do
  it 'inherits from StringIO' do
    VirtualFile.superclass.should == StringIO
  end

  it 'has path reader' do
    @vf = VirtualFile.new("virtual", "elvenpath")

    # =~ /#{Dir::tmpdir}/ causes RegExp to fail with nested *?+ on 1.8.6
    @vf.path.should == "elvenpath"
  end

  it 'has path writer' do
    @vf = VirtualFile.new("virtual", "elvenpath")

    @vf.path = "newbase"
    @vf.path.should == "newbase"
  end
end