Skip to content

Commit

Permalink
Shortcut for Flipper::DSL.new
Browse files Browse the repository at this point in the history
  • Loading branch information
jnunemaker committed Aug 2, 2012
1 parent a9ec907 commit 1df7ff3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/flipper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
require 'flipper/type'

module Flipper
def self.new(*args)
DSL.new(*args)
end

def self.groups
@groups ||= Registry.new
end
Expand Down
7 changes: 7 additions & 0 deletions spec/flipper_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
require 'helper'

describe Flipper do
describe ".new" do
it "returns new instance of dsl" do
instance = Flipper.new(double('Adapter'))
instance.should be_instance_of(Flipper::DSL)
end
end

describe ".groups" do
it "returns a registry instance" do
Flipper.groups.should be_instance_of(Flipper::Registry)
Expand Down

0 comments on commit 1df7ff3

Please sign in to comment.