Skip to content

Commit

Permalink
Merge pull request #1 from venmo/marklarr/readme
Browse files Browse the repository at this point in the history
Marklarr/readme
  • Loading branch information
marklarr committed Jun 25, 2014
2 parents 0004200 + 80c0fdd commit d54b82d
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 6 deletions.
51 changes: 46 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Slather

TODO: Write a gem description
Generate test coverage reports for Xcode projects. Apply tests liberally.

| [Parsimmon](https://github.com/ayanonagon/Parsimmon) | [![Parsimmon Coverage](https://coveralls.io/repos/ayanonagon/Parsimmon/badge.png?branch=master)](https://coveralls.io/r/ayanonagon/Parsimmon?branch=master) |
|------------------------------------------------------------|:----------------------------------------------------:|

## Installation

Expand All @@ -12,16 +15,54 @@ And then execute:

$ bundle

Or install it yourself as:
## Usage

$ gem install slather
Setup your project for test coverage:

## Usage
$ slather setup path/to/project.xcodeproj

This will enable the `Generate Test Coverage` and `Instrument Program Flow` flags for your project.


To test if you're ready to generate test coverage, run your test suite on your project, and then run:

$ slather coverage -s path/to/project.xcodeproj

### Coveralls

Login to https://coveralls.io/ and enable your repository. Right now, `slather` only supports coveralls via Travis CI.

TODO: Write usage instructions here
Make a `.slather.yml` file:

```yml
# .slather.yml

coverage_service: coveralls
xcodeproj: path/to/project.xcodeproj
ignore:
- ExamplePodCode/*
- ProjectTestsGroup/*
```
And then in your `.travis.yml`, call `slather` after a successful_build

```yml
# .travis.yml
after_success: slather
```

### Custom Build Directory

Slather will look for the test coverage files in `DerivedData` by default. If you send build output to a custom location, like [this](https://github.com/erikdoe/ocmock/blob/master/Tools/travis.sh#L12), then you should also set the `build_directory` property in `.slather.yml`

## Contributing

We'd love to see your ideas for improving this library! The best way to contribute is by submitting a pull request. We'll do our best to respond to your patch as soon as possible. You can also submit a [new Github issue](https://github.com/venmo/slather/issues/new) if you find bugs or have questions. :octocat:

Please make sure to follow our general coding style and add test coverage for new features!

## Contributors

* [@tpoulos](https://github.com/tpoulos), the perfect logo.
* [@ayanonagon](https://github.com/ayanonagon) and [@kylef](https://github.com/benzguo), feedback and testing.
2 changes: 1 addition & 1 deletion lib/slather/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def configure_build_directory_from_yml
end

def configure_ignore_list_from_yml
self.ignore_list = (self.class.yml["ignore"] || []) unless self.ignore_list
self.ignore_list = [(self.class.yml["ignore"] || [])].flatten unless self.ignore_list
end

def configure_ci_service_from_yml
Expand Down
6 changes: 6 additions & 0 deletions spec/slather/project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ class SpecCoverageFile < Slather::CoverageFile
expect(fixtures_project.ignore_list).to eq(["test", "ing"])
end

it "should force the ignore_list into an array" do
Slather::Project.stub(:yml).and_return({"ignore" => "test" })
fixtures_project.configure_ignore_list_from_yml
expect(fixtures_project.ignore_list).to eq(["test"])
end

it "should not set the ignore_list if it has already been set" do
Slather::Project.stub(:yml).and_return({"ignore" => ["test", "ing"] })
fixtures_project.ignore_list = ["already", "set"]
Expand Down

0 comments on commit d54b82d

Please sign in to comment.