-
Notifications
You must be signed in to change notification settings - Fork 27
Implement get_feature_variable and create unit tests #190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… into brandon/get_feat_var
mikeproeng37
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly looks ok, just have a small comment. @msohailhussain can you also take a look when you get the chance please
| end | ||
|
|
||
| if variables.include? :variable_type | ||
| # Empty variable_type is a valid user ID. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huh? This can you explain this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If variables[:variable_type] is anything other than a String or null value, it is invalid. Otherwise, it is valid, and so we remove variable_type from variables. That way, it does not go through the value.is_a?(String) && !value.empty? check on line 145.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Thanks
|
@brandonhudavid Can you please resolve lint errors. |
msohailhussain
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
mikeproeng37
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see these two extraneous files in your commit:
experiment_to_return, and variation_to_return, can you remove em?
mikeproeng37
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Summary
get_feature_variablemethod inoptimizely.rbto return value of variable with any typeinputs_valid?function invalidator.rbto allow fornilvariable typeproject_spec.rbto ensure functionality ofget_feature_variableRuby is a dynamically-typed language, like JavaScript, so it suffices to have a single method return the value of a feature variable rather than have a separate method for each possible feature variable type.
Test plan
project_spec.rbIssues