Sha256: be8baa6b22adb0cb5c19645066d2b4761c84ceed850ae5ef5c43b9809429db4c

Contents?: true

Size: 604 Bytes

Versions: 1

Compression:

Stored size: 604 Bytes

Contents

# encoding: UTF-8
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

1 entries across 1 versions & 1 rubygems

Version Path
bencodr-3.0.0 spec/bencodr/io_spec.rb