Sha256: dfa30f9040567098c2298f527df740c45e6ecd74cb7243ac1740ae7b036ed5f8

Contents?: true

Size: 1.13 KB

Versions: 3

Compression:

Stored size: 1.13 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
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
noumenon-0.1.2 spec/noumenon/repository_spec.rb
noumenon-0.1.1 spec/noumenon/repository_spec.rb
noumenon-0.1.0 spec/noumenon/repository_spec.rb