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

Rework mime type matching and provides specs #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fidothe
Copy link
Member

@fidothe fidothe commented Aug 2, 2013

I rewrote the mime type and provides specs we were looking at yesterday morning to show you the kind of thing I think you should be producing. The main things:

  • As few expectations per test as possible. Preferably one. Here the extra overhead for one-expectation per test wasn't really worth it: it's a tradeoff...
  • grouping definitely related tests into contexts. Here, you could even think about breaking the three-action Sinatra app in L126-135 into three apps, one in each of the relevant contexts
  • Explanatory names for tests. If you don't understand what it's doing well enough to name it then google it - read the sinatra docs, read the HTTP spec, ask me or Konstantin...
  • Add as little noise to the tests as possible. Most of the time the app.call 'REQUEST_METHOD' => 'GET', 'PATH_INFO' => '/', 'HTTP_ACCEPT' => 'application/xml', 'rack.input' => '' syntax is just adding noise to your tests, especially if all it's doing is the equivalent of get '/foo'

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

1 participant