-
Notifications
You must be signed in to change notification settings - Fork 1
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
compensated-spec
supports testing Apple In-App purchase events
#84
Conversation
We can merge this ahead of #83, or after. Depends on how small of steps we want in the development branch. |
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.
Looks great, just left a cucumber-ruby
question, feel free to merge.
Given("we have included the `Compensated::Spec::Helpers` mixin in my testing framework") do | ||
include Compensated::Spec::Helpers | ||
end | ||
|
||
When("we generate the {string} fixture") do |fixture_name| | ||
@fixture_output = compensated_event_body(fixture_name) | ||
When("I call {spec_helper} for a {string} fixture with the following overrides:") do |spec_helper, fixture_name, table| |
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.
Do you intended to use spec_helper
soon?
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.
Yes, as we add feature tests for the other helpers defined in lib/compensated/spec
I expect we'll want to use a case statement to indicate which method we want to call similar to the When("I call {spec_helper} for a {string} fixture")
step below.
regexp: /`.*`/, | ||
transformer: ->(s) { s.gsub("`", '') }, | ||
use_for_snippets: true | ||
) |
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 read this: https://cucumber.io/docs/cucumber/cucumber-expressions/#custom-parameter-types but I still don't know what does use_for_snippets: true
do.
Mind giving me an example?
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.
use_for_snippets
ensures that when Cucumber cannot find a step definition, but it thinks a custom parameter type matches a particular chunk of the string, it will include the parameter type in the example step it shows the tester.
I believe use_for_snippets
is true by default, but I was copy-pasting from an example that had use_for_snippets
set to false.
- Moves the `apple_iap` fixtures into `compensated-spec` - Uses `compensated-spec` in the `apple_iap/event_parser_spec.rb`
791a3b9
to
4b025df
Compare
apple_iap
fixtures intocompensated-spec
compensated-spec
in theapple_iap/event_parser_spec.rb