square/fdoc — pull request #44 by damncabbage (2013-09-17 03:20:11+00:00)
Title: Fixes spec failures from File.join being called on a blank options[:template_directory]

Current test failures:

```
.................................................................................FF.FF....FF...........

Failures:

1) Fdoc::EndpointPresenter#to_html should generate valid HTML
Failure/Error: html = subject.to_html
TypeError:
no implicit conversion of nil into String
# ./lib/fdoc/presenters/base_presenter.rb:18:in `join'
# ./lib/fdoc/presenters/base_presenter.rb:18:in `render_erb'
# ./lib/fdoc/presenters/endpoint_presenter.rb:12:in `to_html'
# ./spec/fdoc/presenters/endpoint_presenter_spec.rb:14:in `block (3 levels) in '

2) Fdoc::EndpointPresenter#to_markdown should generate markdown
Failure/Error: markdown = subject.to_markdown
TypeError:
no implicit conversion of nil into String
# ./lib/fdoc/presenters/base_presenter.rb:18:in `join'
# ./lib/fdoc/presenters/base_presenter.rb:18:in `render_erb'
# ./lib/fdoc/presenters/endpoint_presenter.rb:16:in `to_markdown'
# ./spec/fdoc/presenters/endpoint_presenter_spec.rb:24:in `block (3 levels) in '

...
```

This is caused by:

```ruby
class Fdoc::BasePresenter
# ...
def render_erb(erb_name, binding = get_binding)
template_path = File.join(options[:template_directory], erb_name)
```

... Where `options[:template_directory]` is nil (ie. the default).