Sha256: 0a4debfa0327e45537698e32cedd267c3bd5eb75525e07683041d387fe69bf42

Contents?: true

Size: 1.58 KB

Versions: 1

Compression:

Stored size: 1.58 KB

Contents

require 'spec_helper'

describe Noumenon::Repository do
  describe "initialization" do
    it "allows access to any provided options in #options" do
      repo = Noumenon::Repository.new(foo: "bar")
      repo.options[:foo].should == "bar"
    end
  end

  it { should respond_to(:put) }
  describe "calling #put" do
    it "raises a NotImplementedError" do
      lambda { subject.put("foo/bar", "Content") }.should raise_error NotImplementedError
    end

    it "provides some details in the error message" do
      begin
        subject.put("foo/bar", "Content")
      rescue NotImplementedError => e
        e.to_s.should == "This repository type does not support updating it's contents."
      end
    end
  end

  it { should respond_to(:get) }
  describe "calling #get" do
    it "raises a NotImplementedError" do
      lambda { subject.get("foo/bar") }.should raise_error NotImplementedError
    end

    it "provides some details in the error message" do
      begin
        subject.get("foo/bar")
      rescue NotImplementedError => e
        e.to_s.should == "This repository type does not support reading it's contents."
      end
    end
  end

  it { should respond_to(:children) }
  describe "calling #children" do
    it "raises a NotImplementedError" do
      lambda { subject.children("/") }.should raise_error NotImplementedError
    end

    it "provides some details in the error message" do
      begin
        subject.children("/")
      rescue NotImplementedError => e
        e.to_s.should == "This repository type does not support listing children from a path."
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
noumenon-0.1.3 spec/noumenon/repository_spec.rb