Last active
March 10, 2020 20:47
-
-
Save darkbushido/19e9b770ba42d43105682bbd30b266bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def base_method_name(params) | |
if Flipper.enabled?(:feature_flag) | |
base_method_name_feature_enabled(params) | |
else | |
base_method_name_feature_disabled(params) | |
end | |
end | |
def base_method_name_feature_enabled(params) | |
# How it behaves with the feature flag enabled | |
end | |
def base_method_name_feature_disabled(params) | |
# How it behaves without the feature flag enabled | |
end | |
### spec | |
RSpec.describe Object do | |
[true, false].each do |flipper_bool| | |
context "Feature feature_flag=#{flipper_bool}" do | |
before do | |
if flipper_bool | |
Flipper.enable(:feature_flag) | |
else | |
Flipper.disable(:feature_flag) | |
end | |
end | |
it "behaves the same" do | |
end | |
end | |
context "Feature feature_flag=true" do | |
before do | |
Flipper.enable(:feature_flag) | |
end | |
it "behaves this way with the feature enabled" do | |
end | |
end | |
context "Feature feature_flag=false" do | |
before do | |
Flipper.disable(:feature_flag) | |
end | |
it "behaves this way with the feature disabled" do | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment