Sha256: e9894388f570e287823dd74851ee91ad0b4fcdba270f5eb77fefb325e5ba7ea0

Contents?: true

Size: 1.3 KB

Versions: 2

Compression:

Stored size: 1.3 KB

Contents

require 'spec_helper.rb'
require 'smallcage/commands/uri'

describe SmallCage::Commands::Uri do
  it "should prints all uris" do
    path = Pathname.new(File.dirname(__FILE__) + "/data/multifiles")

    old_stdout = $stdout
    begin
      $stdout = StringIO.new
      opts = { :command => "uri", :path => path.to_s }
      SmallCage::Runner.run(opts)
      $stdout.string.should == <<EOT
/index.html
/items/items-000.html
/items/items-001.html
/items/items-002.html
/items/items-003.html
/items/items-004.html

/items/items-after-emptyline.html
EOT
    ensure
      $stdout = old_stdout
    end
  end

  it "should prints partial uris" do
    path = Pathname.new(File.dirname(__FILE__) + "/data/multifiles")

    old_stdout = $stdout
    begin
      $stdout = StringIO.new
      opts = { :command => "uri", :path => path.to_s + "/index.html.smc" }
      SmallCage::Runner.run(opts)
      $stdout.string.should == <<EOT
/index.html
EOT

      $stdout = StringIO.new
      opts = { :command => "uri", :path => path.to_s + "/items/index.html.smc"}
      SmallCage::Runner.run(opts)
      $stdout.string.should == <<EOT
/items/items-000.html
/items/items-001.html
/items/items-002.html
/items/items-003.html
/items/items-004.html

/items/items-after-emptyline.html
EOT
      
    ensure
      $stdout = old_stdout
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
smallcage-0.2.4 spec/uri_spec.rb
smallcage-0.2.3 spec/uri_spec.rb