Permalink
Browse files

Added actors shortcut

  • Loading branch information...
1 parent b0e371e commit bd67020ce7570ffc32e962c0bde9b54c4450daca @jnunemaker committed Aug 2, 2012
Showing with 18 additions and 0 deletions.
  1. +4 −0 lib/flipper/dsl.rb
  2. +14 −0 spec/flipper/dsl_spec.rb
View
@@ -46,6 +46,10 @@ def random(number)
Flipper::Types::PercentageOfRandom.new(number)
end
+ def actors(number)
+ Flipper::Types::PercentageOfActors.new(number)
+ end
+
private
def features
@@ -152,4 +152,18 @@ def feature(name)
@result.value.should eq(5)
end
end
+
+ describe "#actors" do
+ before do
+ @result = subject.actors(17)
+ end
+
+ it "returns percentage of actors" do
+ @result.should be_instance_of(Flipper::Types::PercentageOfActors)
+ end
+
+ it "sets value" do
+ @result.value.should eq(17)
+ end
+ end
end

0 comments on commit bd67020

Please sign in to comment.