Sha256: a53045c2da5afe10f397ec7085f191f04ddd4ab9f591efc4f481f81bdd301de9

Contents?: true

Size: 1.78 KB

Versions: 10

Compression:

Stored size: 1.78 KB

Contents

shared "http" do
  it "should not be writable" do
    location("/a.txt").should.not.be.writable
  end

  it "should read files" do
    location("/a.txt").read.should == "A"
    location("/b.txt").read.should == "AB"
    location("/c.txt").read.should == "ABC"
    location("/dir/d.txt").read.should == "ABCD"
  end

  it "should get size" do
    location("/a.txt").size.should == 1
    location("/b.txt").size.should == 2
    location("/c.txt").size.should == 3
    location("/dir/d.txt").size.should == 4
  end

  it "should get mtime" do
    location("/a.txt").mtime.to_s.should == File.mtime(File.join(@path, "a.txt")).to_s
    location("/b.txt").mtime.to_s.should == File.mtime(File.join(@path, "b.txt")).to_s
    location("/c.txt").mtime.to_s.should == File.mtime(File.join(@path, "c.txt")).to_s
    location("/dir/d.txt").mtime.to_s.should == File.mtime(File.join(@path, "dir", "d.txt")).to_s
  end

  it "should exist" do
    location("/a.txt").should.exist
    location("/b.txt").should.exist
    location("/c.txt").should.exist
    location("/dir/d.txt").should.exist
  end

  it "should not exist" do
    location("/d.txt").should.not.exist
    location("/dir").should.not.exist
  end

  it "should be files" do
    location("/a.txt").should.be.file
    location("/b.txt").should.be.file
    location("/c.txt").should.be.file
    location("/dir/d.txt").should.be.file
  end

  it "should not be files" do
    location("/d.txt").should.not.file
    location("/dir").should.not.file
  end

  it "should not be directories" do
    location("/a.txt").should.not.be.directory
    location("/b.txt").should.not.be.directory
    location("/c.txt").should.not.be.directory
    location("/dir/d.txt").should.not.be.directory
    location("/d.txt").should.not.directory
    location("/dir").should.not.directory
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
pione-0.5.0 test/location/http-behavior.rb
pione-0.5.0.alpha.2 test/location/http-behavior.rb
pione-0.5.0.alpha.1 test/location/http-behavior.rb
pione-0.4.2 test/location/http-behavior.rb
pione-0.4.1 test/location/http-behavior.rb
pione-0.4.0 test/location/http-behavior.rb
pione-0.3.2 test/location/http-behavior.rb
pione-0.3.1 test/location/http-behavior.rb
pione-0.3.0 test/location/http-behavior.rb
pione-0.2.2 test/location/http-behavior.rb