Skip to content

Instantly share code, notes, and snippets.

@lazerwalker
Last active December 20, 2015 12:39
Show Gist options
  • Save lazerwalker/6132709 to your computer and use it in GitHub Desktop.
Save lazerwalker/6132709 to your computer and use it in GitHub Desktop.
Failing example for no_doc
resource 'No_Doc Test' do
get "/api/foo" do
example_request "should appear in docs" do
true.should be
end
example_request "should NOT appear in docs" do
no_doc do
true.should be
end
end
end
end
@mchesler
Copy link

mchesler commented Aug 1, 2013

Have you tried the following?

example_request "should NOT appear in docs", :document => false do
  true.should be
end

@oestrich
Copy link

oestrich commented Aug 1, 2013

no_doc is supposed to allow requests to be made in a documented example and have those requests not be called.

So:

resource 'No_Doc Test' do
  get "/api/foo" do
    example "Documenting" do
      no_doc do
        client.get "/" # should not appear in docs
      end

      do_request # should appear in docs

      client.get "/other_thing" # should appear in docs
    end
  end
end

In your example, @mchesler is correct, you want :document => false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment