Skip to content

Commit

Permalink
Delegate register from Alchemist to Library
Browse files Browse the repository at this point in the history
  • Loading branch information
halogenandtoast committed Feb 1, 2014
1 parent 948c050 commit 618cdc3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/alchemist.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ def self.config
@configuration ||= Configuration.new
end

def self.register(types, names, value)
library.register(types, names, value)
end

private

def self.load_all_categories
Expand Down
6 changes: 6 additions & 0 deletions spec/alchemist_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
expect(unit).to eq(1.meter)
end

it "delegates register to the Library" do
allow(Alchemist.library).to receive(:register)
Alchemist.register(:foo, :bar, :baz)
expect(Alchemist.library).to have_received(:register).with(:foo, :bar, :baz)
end

def build_category_module
double.tap do |category_module|
module_builder = double()
Expand Down

0 comments on commit 618cdc3

Please sign in to comment.