Skip to content

Commit e097089

Browse files
committedFeb 7, 2021
Add information about test harness
1 parent fbac281 commit e097089

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed
 

‎README.md

+9-10
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,19 @@ including a snippet like the following in your mailer method
8181
Many csv files are quite large, and need to be streamed rather than return in a single shot. Csv stream handling is based on [an epic answer on stackoverflow about rails and streaming.](http://stackoverflow.com/questions/3507594/ruby-on-rails-3-streaming-data-through-rails-to-client). Streaming requires configuration of your rails app - you need to use a Rack that supports streaming. I've tested with Unicorn, and created [a separate sample](https://github.com/fawce/test_csv_streamer) project to facilitate testing on Heroku. (ed: *this note is very old and streaming support has not been updated lately*)
8282

8383

84-
## Contributions
84+
## Testing
8585

86-
As of version 2.0 this gem has a rudimentary spec suite for Rails 3. The test suite has been run under both Ruby 1.8
87-
and 1.9. The requirements are in the Gemfile within the test spec directory. You will need Bundler installed and then
88-
you can run:
86+
The test harness here is a little unusual in that it wires in a standard rails app and then monkeypatches it in the
87+
specs. Because there is a standard rails app, it has its own Gemfile which is modified to refer back to the gemspec so
88+
that you can use the standard workflow:
8989

90-
cd spec/rails_app && bundle install && cd ../..
90+
bundle install && rake spec
9191

92-
To install the main testing requirements. Then return back to the root directory and run:
93-
94-
rake spec
95-
96-
I will also take patches for Rails 2.3.x, though I personally have no further need of that branch.
92+
Note that this means there are multiple `Gemfile.lock` files generated. Per gem development best practices, those files
93+
are not committed, and it can be easy to forget to remove all of them when you want to try a clean build after updating
94+
some dependency. Suggestion is to do:
9795

96+
rm ./**/Gemfile.lock && bundle install && rake spec
9897

9998
## Troubleshooting
10099

0 commit comments

Comments
 (0)
Please sign in to comment.