jejacks0n / teaspoon

Teaspoon: Javascript test runner for Rails. Use Selenium, BrowserStack, or PhantomJS.
1.43k stars 243 forks source link

pass arguments to hook #260

Closed taboularasa closed 10 years ago

taboularasa commented 10 years ago

I don't know how you guys feel about this but I think it would be useful to allow arguments to be passed to user defined hooks. Eg:

args = JSON.stringify({'hook_args': {'foo': 'bar'}})
Teaspoon.hook('my_hook', { 'method': 'POST', 'payload': args})
coveralls commented 10 years ago

Coverage Status

Coverage remained the same when pulling 7ed685be0638595bb282b6dbcbdc7e2fc4b9a1f2 on taboularasa:master into d5d791e9587d124da886d8580d35409875235783 on modeset:master.

jejacks0n commented 10 years ago

Thanks. That's fine, but would you update the docs?

taboularasa commented 10 years ago

@jejacks0n sure thing. Do you care that I made Content-Type default to application/json? Also should I add test coverage to spec/features/hooks_spec.rb or elsewhere?

jejacks0n commented 10 years ago

I'm unsure on the JSON bit, but since I've never used the hooks, it's kinda up to you, and for others to contribute to.

As for tests, yes, coverage stayed the same, but if you don't want me or someone else to break it later you should have a test (at least a unit test). In general terms I try not to break specs, but if it's not tested I'm known to "clean it up". :)

coveralls commented 10 years ago

Coverage Status

Coverage remained the same when pulling 38bb54772514789429f04af00ab43bdb2b79850d on taboularasa:master into d5d791e9587d124da886d8580d35409875235783 on modeset:master.

jejacks0n commented 10 years ago

Looks good. Thanks. Let's just get some unit tests around it so I don't break it later. :)

taboularasa commented 10 years ago

I'll try to wrap this up sometime today.

coveralls commented 10 years ago

Coverage Status

Coverage increased (+0.0%) when pulling b7dd4cd81d57576b0ff3a2e290578c0158e15888 on taboularasa:master into d5d791e9587d124da886d8580d35409875235783 on modeset:master.

coveralls commented 10 years ago

Coverage Status

Coverage increased (+0.0%) when pulling 8a9febfacf421ea88d5e87a3ef547cc53b543840 on taboularasa:master into d5d791e9587d124da886d8580d35409875235783 on modeset:master.

coveralls commented 10 years ago

Coverage Status

Coverage increased (+0.0%) when pulling 7c92696bebc87c1bb240e00438a08e6cf07478bb on taboularasa:master into d5d791e9587d124da886d8580d35409875235783 on modeset:master.

taboularasa commented 10 years ago

@jejacks0n this should be good to merge now. Let me know if theres anything else I need

coveralls commented 10 years ago

Coverage Status

Coverage increased (+0.0%) when pulling 558ef740a218677779b6e6d8a4ff59c3404fb2f6 on taboularasa:master into d5d791e9587d124da886d8580d35409875235783 on modeset:master.

jejacks0n commented 10 years ago

Thanks!

taboularasa commented 10 years ago

:+1: thanks for teaspoon!