Sha256: 46191089f77898d47a6660862684cc69f9454522392844208a70b4147e926792

Contents?: true

Size: 586 Bytes

Versions: 2

Compression:

Stored size: 586 Bytes

Contents

require "spec_helper"

describe File do
  before :all do
    @path = "tmp"
    Dir.mkdir(@path) unless File.exists? @path
    BEncodr.include!
  end

  before :each do
    @file = File.join(@path, 'test.bencodr')
    @object = "string"
    File.bencode(@file, @object)
  end
  
  describe "#bencode" do
    subject{ File }
    
    it{ File.should exist(@file) }
  end
  
  describe "#bdecode" do
    subject{ File }
    it{ should bdecode(@file).to(@object) }
  end
  
  after :each do
    File.delete(@file)
  end

  after :all do
    Dir.delete(@path) if File.exists? @path
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bencodr-2.0.1 spec/bencodr/io_spec.rb
bencodr-2.0.0 spec/bencodr/io_spec.rb