Permalink
Browse files

Made Loader no longer a Singleton

  • Loading branch information...
1 parent 8f1a151 commit b1e5df446e345c7ea98ccb902be96d881fefbe79 @krakatoa krakatoa committed Feb 11, 2013
Showing with 3 additions and 6 deletions.
  1. +2 −5 lib/protocol/loader.rb
  2. +1 −1 spec/protocol_spec.rb
View
@@ -1,10 +1,7 @@
-require 'singleton'
-
module Cucub
module Protocol
class Loader
- include Singleton
-
+
# Sets the path from where the config will be read
#
# @param [String] filepath
@@ -48,7 +45,7 @@ def parse_object_specification(class_name, section)
end
def parse_action_specification(class_name, action_name, section)
- action_specification = Cucub::Protocol::ActionSpecification.new(class_name, action_name)
+ action_specification = Cucub::Protocol::ActionSpecification.new(class_name, action_name, self)
section.each_pair { |key, value|
action_specification.send("#{key}=".to_sym, value)
View
@@ -6,7 +6,7 @@
end
describe "#parse" do
- subject { Cucub::Protocol::Loader.instance }
+ subject { Cucub::Protocol::Loader.new }
context "when parsing a valid config" do
before { subject.set_path(@filepath + "/mock/protocol.ini") }
it { subject.parse.should be_a Cucub::Protocol::SpecificationSet }

0 comments on commit b1e5df4

Please sign in to comment.