square / fdoc

Documentation format and verification
Other
380 stars 59 forks source link

Fixes spec failures from File.join being called on a blank options[:template_directory] #44

Closed damncabbage closed 11 years ago

damncabbage commented 11 years ago

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 <top (required)>'

  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 <top (required)>'

...

This is caused by:

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).

zachmargolis commented 11 years ago

Thanks for fixing these! Can you please sign the Individual Contributor License Agreement so we can merge this and your other PRs?