Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Aliased random and actors to more full names

Sometimes I forget to use the shortcuts.
  • Loading branch information...
commit f7f9a4174b726d31f45d13c94b44cb3ffeda5d8e 1 parent de74f4b
@jnunemaker authored
Showing with 10 additions and 0 deletions.
  1. +2 −0  lib/flipper/dsl.rb
  2. +8 −0 spec/flipper/dsl_spec.rb
View
2  lib/flipper/dsl.rb
@@ -41,10 +41,12 @@ def actor(thing)
def random(number)
Types::PercentageOfRandom.new(number)
end
+ alias :percentage_of_random :random
def actors(number)
Types::PercentageOfActors.new(number)
end
+ alias :percentage_of_actors :actors
def features
adapter.features.map { |name| feature(name) }.to_set
View
8 spec/flipper/dsl_spec.rb
@@ -155,6 +155,10 @@ def feature(name)
it "sets value" do
@result.value.should eq(5)
end
+
+ it "is aliased to percentage_of_random" do
+ @result.should eq(subject.percentage_of_random(@result.value))
+ end
end
describe "#actors" do
@@ -169,6 +173,10 @@ def feature(name)
it "sets value" do
@result.value.should eq(17)
end
+
+ it "is aliased to percentage_of_actors" do
+ @result.should eq(subject.percentage_of_actors(@result.value))
+ end
end
describe "#features" do
Please sign in to comment.
Something went wrong with that request. Please try again.