constant default_move_duration prevents appium to override it - #6189
Conversation
f6c1283 to
6f1572f
Compare
There was a problem hiding this comment.
if you want to remove the constant, the best way of defining it will be as a private memoized method
private
def default_move_duration
@default_move_duration ||= 0.25
end
You also can remove the reader and writer, as the writer isn't used and the reader becomes this memo
There was a problem hiding this comment.
The reason for this PR is that the constant is being overridden in the Appium library, so this would change to specifically allow a writer.
There was a problem hiding this comment.
That's fair, I still wouldn't have procedurally defined instance vars, but each to their own.
There was a problem hiding this comment.
There's no reason to wrap the default in a method. Leverage the accessor.
|
Looks good, but please fix unit tests and RuboCop: |
There was a problem hiding this comment.
since this is no longer a constant, it needs to be referenced as a method on the class that includes the PointerActions module. In this case, builder. Update this to be:
let(:duration) { builder.default_move_duration }
…he spec which references the instance var as a method)
|
lint and unit test works now. |
p0deje
left a comment
There was a problem hiding this comment.
Looks good. Titus, please merge 👍
Xin the preceding checkbox, I verify that I have signed the Contributor License Agreement