Skip to content
Browse files

more rdoc cleanup

  • Loading branch information...
1 parent 80febb5 commit c1f0eab32b911cab1957dfba4294a9ccb5e43c71 @dchelimsky dchelimsky committed Dec 8, 2011
View
1 .yardopts
@@ -2,6 +2,7 @@
--exclude features
--exclude lib/generators/**/*_spec.rb
--markup markdown
+--template-path yard/template/
-
README.md
Changelog.md
View
15 README.md
@@ -58,21 +58,6 @@ gem "webrat"
gem "capybara"
```
-### Autotest
-
-The `rspec:install` generator creates an `.rspec` file, which tells Autotest
-that you're using RSpec and Rails. You'll also need to add the ZenTest gem to
-your Gemfile:
-
-```ruby
-gem "ZenTest"
-```
-
-At this point, if all of the gems in your Gemfile are installed in system
-gems, you can just type `autotest`. If, however, Bundler is managing any gems
-for you directly (i.e. you've got `:git` or `:path` attributes in the `Gemfile`),
-you'll need to run `bundle exec autotest`.
-
## Living on edge
Bundler makes it a snap to use the latest code for any gem your app depends on. For
View
43 lib/rspec/rails/example/controller_example_group.rb
@@ -18,28 +18,27 @@ def controller_class
described_class
end
- # Supports a simple DSL for specifying behaviour of
- # ApplicationController. Creates an anonymous subclass of
- # ApplicationController and evals the +body+ in that context. Also sets
- # up implicit routes for this controller, that are separate from those
- # defined in <tt>config/routes.rb</tt>.
+ # Supports a simple DSL for specifying behavior of ApplicationController.
+ # Creates an anonymous subclass of ApplicationController and evals the
+ # `body` in that context. Also sets up implicit routes for this
+ # controller, that are separate from those defined in "config/routes.rb".
#
- # ## Examples
+ # @example
#
- # describe ApplicationController do
- # controller do
- # def index
- # raise ApplicationController::AccessDenied
- # end
- # end
+ # describe ApplicationController do
+ # controller do
+ # def index
+ # raise ApplicationController::AccessDenied
+ # end
+ # end
#
- # describe "handling AccessDenied exceptions" do
- # it "redirects to the /401.html page" do
- # get :index
- # response.should redirect_to("/401.html")
- # end
- # end
- # end
+ # describe "handling AccessDenied exceptions" do
+ # it "redirects to the /401.html page" do
+ # get :index
+ # response.should redirect_to("/401.html")
+ # end
+ # end
+ # end
#
# If you would like to spec a subclass of ApplicationController, call
# controller like so:
@@ -49,10 +48,10 @@ def controller_class
# end
#
# NOTICE: Due to Ruby 1.8 scoping rules in anoymous subclasses, constants
- # defined in +ApplicationController+ must be fully qualified (e.g.
+ # defined in `ApplicationController` must be fully qualified (e.g.
# ApplicationController::AccessDenied) in the block passed to the
- # +controller+ method. Any instance methods, filters, etc, that are
- # defined in +ApplicationController+, however, are accessible from within
+ # `controller` method. Any instance methods, filters, etc, that are
+ # defined in `ApplicationController`, however, are accessible from within
# the block.
def controller(base_class = nil, &body)
base_class ||= RSpec.configuration.infer_base_class_for_anonymous_controllers? ?
View
36 lib/rspec/rails/example/view_example_group.rb
@@ -35,27 +35,27 @@ module InstanceMethods
# The only addition is that you can call render with no arguments, and RSpec
# will pass the top level description to render:
#
- # describe "widgets/new.html.erb" do
- # it "shows all the widgets" do
- # render # => view.render(:file => "widgets/new.html.erb")
- # ...
+ # describe "widgets/new.html.erb" do
+ # it "shows all the widgets" do
+ # render # => view.render(:file => "widgets/new.html.erb")
+ # # ...
+ # end
# end
- # end
def render(options={}, local_assigns={}, &block)
options = {:template => _default_file_to_render} if Hash === options and options.empty?
super(options, local_assigns, &block)
end
- # The instance of +ActionView::Base+ that is used to render the template.
- # Use this to stub methods _before_ calling +render+.
+ # The instance of `ActionView::Base` that is used to render the template.
+ # Use this to stub methods _before_ calling `render`.
#
- # describe "widgets/new.html.erb" do
- # it "shows all the widgets" do
- # view.stub(:foo) { "foo" }
- # render
- # ...
+ # describe "widgets/new.html.erb" do
+ # it "shows all the widgets" do
+ # view.stub(:foo) { "foo" }
+ # render
+ # # ...
+ # end
# end
- # end
def view
_view
end
@@ -65,28 +65,28 @@ def view
# help isolate view examples from partials rendered by the view template
# that is the subject of the example.
#
- # ## Example
+ # @example
#
- # stub_template("widgets/_widget.html.erb" => "This content.")
+ # stub_template("widgets/_widget.html.erb" => "This content.")
def stub_template(hash)
view.view_paths.unshift(ActionView::FixtureResolver.new(hash))
end
# Provides access to the params hash that will be available within the
# view:
#
- # params[:foo] = 'bar'
+ # params[:foo] = 'bar'
def params
controller.params
end
- # @deprecated # use +view+ instead.
+ # @deprecated # use `view` instead.
def template
RSpec.deprecate("template","view")
view
end
- # @deprecated # use +rendered+ instead.
+ # @deprecated # use `rendered` instead.
def response
RSpec.deprecate("response", "rendered")
rendered
View
6 lib/rspec/rails/extensions/active_record/base.rb
@@ -3,9 +3,9 @@ module Rails
if defined?(ActiveRecord)
module Extensions
module ActiveRecord
- # Extension to enhance +should have+ on AR Model classes
+ # Extension to enhance `should have` on AR Model classes
#
- # ## Examples:
+ # @example
#
# ModelClass.should have(:no).records
# ModelClass.should have(1).record
@@ -30,7 +30,7 @@ module ::ActiveModel::Validations
#
# You can also use this to specify the content of the error messages.
#
- # ## Examples:
+ # @example
#
# model.should have(:no).errors_on(:attribute)
# model.should have(1).error_on(:attribute)
View
4 lib/rspec/rails/matchers/be_a_new.rb
@@ -10,7 +10,7 @@ def matches?(actual)
# Use this to specify the specific attributes to match on the new record.
#
- # ## Examples:
+ # @example
#
# it "assigns a new Thing with the submitted attributes" do
# post :create, :thing => { :name => "Illegal Value" }
@@ -60,7 +60,7 @@ def unmatched_attributes
# `persisted?`. Typically used to specify instance variables assigned to
# views by controller actions
#
- # ## Examples:
+ # @example
#
# get :new
# assigns(:thing).should be_a_new(Thing)
View
2 lib/rspec/rails/matchers/be_new_record.rb
@@ -10,7 +10,7 @@ def matches?(actual)
# Passes if actual returns `false` for `persisted?`.
#
- # ## Examples:
+ # @example
#
# get :new
# assigns(:thing).should be_new_record
View
2 lib/rspec/rails/matchers/redirect_to.rb
@@ -28,7 +28,7 @@ def failure_message_for_should_not
# Delegates to `assert_redirected_to`
#
- # ## Examples:
+ # @example
#
# response.should redirect_to(:action => "new")
def redirect_to(target)
View
2 lib/rspec/rails/matchers/render_template.rb
@@ -29,7 +29,7 @@ def failure_message_for_should_not
# Delegates to `assert_template`
#
- # ## Examples:
+ # @example
#
# response.should render_template("new")
def render_template(options, message=nil)
View
4 lib/rspec/rails/matchers/routing_matchers.rb
@@ -37,7 +37,7 @@ def failure_message_for_should
# Delegates to `assert_recognizes`. Supports short-hand controller/action
# declarations (e.g. `"controller#action"`).
#
- # ## Examples
+ # @example
#
# { :get => "/things/special" }.should route_to(
# :controller => "things",
@@ -78,7 +78,7 @@ def failure_message_for_should_not
# the declarations in `config/routes.rb`. Delegates to
# `RouteSet#recognize_path`.
#
- # ## Examples:
+ # @example
#
# You can use route helpers provided by rspec-rails.
# {:get => "/a/path"}.should be_routable
View
2 lib/rspec/rails/mocks.rb
@@ -200,7 +200,7 @@ def connection
# helper), it is especially useful in view examples, which are
# inherently more state-based than interaction-based.
#
- # ## Examples
+ # @example
#
# stub_model(Person)
# stub_model(Person).as_new_record
View
4 lib/rspec/rails/view_assigns.rb
@@ -7,9 +7,9 @@ module InstanceMethods
# Assigns a value to an instance variable in the scope of the
# view being rendered.
#
- # ## Examples
+ # @example
#
- # assign(:widget, stub_model(Widget))
+ # assign(:widget, stub_model(Widget))
def assign(key, value)
_encapsulated_assigns[key] = value
end
View
4 yard/template/default/fulldoc/html/css/rspec.css
@@ -0,0 +1,4 @@
+code {
+ background-color: #F0F0F0;
+ padding: 0 2px 0 2px;
+}
View
6 yard/template/default/layout/html/setup.rb
@@ -0,0 +1,6 @@
+# Docs suggest I don't need this, but ...
+YARD::Server::Commands::StaticFileCommand::STATIC_PATHS << File.expand_path("../../../fulldoc/html/", __FILE__)
+
+def stylesheets
+ super + ['css/rspec.css']
+end

0 comments on commit c1f0eab

Please sign in to comment.
Something went wrong with that request. Please try again.