XCPretty is tested with Cucumber and RSpec. If you're planning to contribute, please do write tests.
Here's an example workflow for a contribution:
- Make separate branches for unrelated changes, like
my-awesome-feature
orfix-terrible-bug
- These are a full-stack end to end tests
- You can find features in
features/
. You'll need to write afeature
and implement it'ssteps
. - Try to reuse as many matchers as possible
- This tests are slower because they're executing
xcpretty
command for each test
Here's an example feature for adding output without UTF8:
Scenario: Running tests without UTF-8 support
Given I have a passing test in my suite
And I pipe to xcpretty with "--no-utf"
Then I should see a non-utf prefixed output
And the steps:
Given I have a passing test in my suite
Given(/^I have a passing test in my suite$/) do
add_run_input SAMPLE_OCUNIT_TEST
end
And I pipe to xcpretty with "--no-utf"
When(/^I pipe to xcpretty with "(.*?)"$/) do |flags|
run_xcpretty(flags)
end
Then I should see a non-utf prefixed output
Then(/^I should see a non-utf prefixed output$/) do
run_output.should start_with(".")
end
- These are unit tests, and they're very fast (below 200ms for the entire suite)
- You should be running them continuously with
kicker
, or your awesome Vim binding
- This should fix unit tests one-by-one, and finally your
feature
will be passing