File: provider_spec.rb

package info (click to toggle)
ruby-configurate 0.0.8-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 144 kB
  • ctags: 55
  • sloc: ruby: 666; makefile: 5
file content (19 lines) | stat: -rw-r--r-- 593 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require 'spec_helper'

describe Configurate::Provider::Base do
  describe "#lookup" do
    subject { described_class.new }
    it "calls #lookup_path" do
      path = Configurate::SettingPath.new(["foo", "bar"])
      subject.should_receive(:lookup_path).with(path).and_return("something")
      subject.lookup(path).should == "something"
    end
    
    it "raises SettingNotFoundError if the #lookup_path returns nil" do
      subject.stub(:lookup_path).and_return(nil)
      expect {
        subject.lookup("bla")
      }.to raise_error Configurate::SettingNotFoundError
    end
  end
end