From afb8f59b9333dadd5129c0862e5677c100c803a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 3 Jan 2012 17:22:45 +0100 Subject: config: fix + add spec for [] and []= methods --- lib/zorglub/config.rb | 4 ++-- spec/node_spec.rb | 1 + spec/spec_helper.rb | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/zorglub/config.rb b/lib/zorglub/config.rb index acf828e..44574a9 100644 --- a/lib/zorglub/config.rb +++ b/lib/zorglub/config.rb @@ -15,11 +15,11 @@ module Zorglub class << self # def [] k - options[k] + @options[k] end # def []= k, v - option[k]=v + @options[k]=v end # def view_base_path diff --git a/spec/node_spec.rb b/spec/node_spec.rb index db5f3f6..f25c45a 100644 --- a/spec/node_spec.rb +++ b/spec/node_spec.rb @@ -8,6 +8,7 @@ describe Zorglub do # it "engine should return default Node's engine" do Node0.engine.should == Zorglub::Config.engine + Node0.engine.should == Zorglub::Config[:engine] end # it "layout should return default Node's layout" do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index fd3e951..d0356a0 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -17,7 +17,7 @@ Zorglub::Config.register_engine 'default', nil, ENGINE_PROC Zorglub::Config.register_engine 'spec-engine-1', 'spec', ENGINE_PROC Zorglub::Config.register_engine 'spec-engine-2', 'spec', ENGINE_PROC # -Zorglub::Config.engine = 'default' +Zorglub::Config[:engine] = 'default' Zorglub::Config.root = File.join Dir.pwd, 'spec', 'data' # class Temp < Zorglub::Node -- cgit v1.1-2-g2b99