File: configurate_spec.rb

package info (click to toggle)
ruby-configurate 0.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 200 kB
  • sloc: ruby: 992; makefile: 5
file content (27 lines) | stat: -rw-r--r-- 709 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# frozen_string_literal: true

require "spec_helper"

describe Configurate::Settings do
  describe "#method_missing" do
    subject { described_class.create }

    it "delegates the call to a new proxy object" do
      proxy = double
      expect(Configurate::Proxy).to receive(:new).and_return(proxy)
      expect(proxy).to receive(:method_missing).with(:some_setting).and_return("foo")
      subject.some_setting
    end
  end

  %i(lookup add_provider []).each do |method|
    describe method.to_s do
      subject { described_class.create }

      it "delegates the call to #lookup_chain" do
        expect(subject.lookup_chain).to receive(method)
        subject.send(method)
      end
    end
  end
end