Sha256: 18c987843a6bef74a4ddaf6d8c32aab1e0e7803baad4c38d7d6928d605236174

Contents?: true

Size: 765 Bytes

Versions: 4

Compression:

Stored size: 765 Bytes

Contents

require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])

describe Feedzirra::Backend::Filesystem do
  before do
    @backend = Feedzirra::Backend::Filesystem.new({:path => '/tmp'})
  end
  
  it_should_behave_like "all backends"
  
  it "should accept a Hash of options for inialization" do
    Feedzirra::Backend::Filesystem.new({:path => '/tmp'})
  end
  
  describe "#filename_for" do
    it "should default to the users' home path plus the MD5 of the normalized URL" do
      MD5.expects(:hexdigest).returns('bah')
      uri = mock('uri')
      uri.expects(:normalize).returns('foo')
      URI.expects(:parse).returns(uri)
      Feedzirra::Backend::Filesystem.new({:path => '/tmp'}).__send__(:filename_for, 'hey').should == '/tmp/bah'
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
jsl-feedzirra-0.0.12.2 spec/feedzirra/backend/filesystem_spec.rb
jsl-feedzirra-0.0.12.3 spec/feedzirra/backend/filesystem_spec.rb
jsl-feedzirra-0.0.12.4 spec/feedzirra/backend/filesystem_spec.rb
jsl-feedzirra-0.0.12.5 spec/feedzirra/backend/filesystem_spec.rb