Sha256: 764d865aec6f9e33c1b04695ee3c06973b5c937ebc0cf97b3c9807362c2f1ece

Contents?: true

Size: 1.3 KB

Versions: 8

Compression:

Stored size: 1.3 KB

Contents

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

describe SmallCage::Commands::Uri do
  it "should prints all uris" do
    path = Pathname.new(File.join(SPEC_DATA_DIR, '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.join(SPEC_DATA_DIR, '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

8 entries across 8 versions & 1 rubygems

Version Path
smallcage-0.3.2 spec/lib/smallcage/commands/uri_spec.rb
smallcage-0.3.1 spec/lib/smallcage/commands/uri_spec.rb
smallcage-0.3.0 spec/lib/smallcage/commands/uri_spec.rb
smallcage-0.2.9 spec/lib/smallcage/commands/uri_spec.rb
smallcage-0.2.8 spec/lib/smallcage/commands/uri_spec.rb
smallcage-0.2.7 spec/lib/smallcage/commands/uri_spec.rb
smallcage-0.2.6 spec/lib/smallcage/commands/uri_spec.rb
smallcage-0.2.5 spec/lib/smallcage/commands/uri_spec.rb