Skip to content
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

Merged
merged 1 commit into from
Jun 18, 2020

Conversation

zspencer
Copy link
Member

  • Moves the apple_iap fixtures into compensated-spec
  • Uses compensated-spec in the apple_iap/event_parser_spec.rb

@zspencer
Copy link
Member Author

We can merge this ahead of #83, or after. Depends on how small of steps we want in the development branch.

Copy link
Contributor

@user512 user512 left a 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|
Copy link
Contributor

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?

Copy link
Member Author

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
)
Copy link
Contributor

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?

Copy link
Member Author

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.

@zspencer zspencer changed the base branch from use-compensated-spec-in-compensated-ruby-tests to 0.X June 18, 2020 15:03
- Moves the `apple_iap` fixtures into `compensated-spec`
- Uses `compensated-spec` in the `apple_iap/event_parser_spec.rb`
@zspencer zspencer force-pushed the 68/move-apple-iap-fixtures-to-compensated-spec branch from 791a3b9 to 4b025df Compare June 18, 2020 15:08
@zspencer zspencer merged commit 9c4f4b3 into 0.X Jun 18, 2020
@zspencer zspencer deleted the 68/move-apple-iap-fixtures-to-compensated-spec branch June 18, 2020 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants