spec/unit/hanami/config/views_spec.rb in hanami-2.0.0.beta4 vs spec/unit/hanami/config/views_spec.rb in hanami-2.0.0.rc1

- old
+ new

@@ -26,20 +26,10 @@ it "does not include the inflector setting" do expect(views).not_to respond_to(:inflector) expect(views).not_to respond_to(:inflector=) end - describe "#settings" do - it "includes locally defined settings" do - expect(views.settings).to include :parts_path - end - - it "includes all view settings apart from inflector" do - expect(views.settings).to include (Hanami::View.settings - [:inflector]) - end - end - it "preserves default values from the base view config" do expect(views.layouts_dir).to eq Hanami::View.config.layouts_dir end it "allows settings to be configured independently of the base view config" do @@ -78,15 +68,15 @@ it "is frozen" do expect(views).to be_frozen end it "does not allow changes to locally defined settings" do - expect { views.parts_path = "parts" }.to raise_error(Dry::Configurable::FrozenConfig) + expect { views.parts_path = "parts" }.to raise_error(Dry::Configurable::FrozenConfigError) end it "does not allow changes to base view settings" do - expect { views.paths = [] }.to raise_error(Dry::Configurable::FrozenConfig) + expect { views.paths = [] }.to raise_error(Dry::Configurable::FrozenConfigError) end end end context "hanami-view is not bundled" do @@ -94,10 +84,10 @@ allow(Hanami).to receive(:bundled?).and_call_original expect(Hanami).to receive(:bundled?).with("hanami-view").and_return(false) end it "does not expose any settings" do - is_expected.not_to be_an_instance_of(Hanami::Config::Views) + is_expected.to be_an_instance_of(Hanami::Config::NullConfig) is_expected.not_to respond_to(:layouts_dir) is_expected.not_to respond_to(:layouts_dir=) end it "can be finalized" do