Skip to content
Browse files

Identify ruby code for syntax highlighting

Fixes #617
  • Loading branch information...
1 parent 1dd534b commit 78b151a8f3fb2fd49c72b4fa7d1b0f8a517b8b36 @vanstee vanstee committed
View
10 features/controller_specs/anonymous_controller.feature
@@ -21,7 +21,7 @@ Feature: anonymous controller
Scenario: specify error handling in ApplicationController
Given a file named "spec/controllers/application_controller_spec.rb" with:
- """
+ """ruby
require "spec_helper"
class ApplicationController < ActionController::Base
@@ -56,7 +56,7 @@ Feature: anonymous controller
Scenario: specify error handling in subclass of ApplicationController
Given a file named "spec/controllers/application_controller_subclass_spec.rb" with:
- """
+ """ruby
require "spec_helper"
class ApplicationController < ActionController::Base
@@ -94,7 +94,7 @@ Feature: anonymous controller
Scenario: infer base class from the described class
Given a file named "spec/controllers/base_class_can_be_inferred_spec.rb" with:
- """
+ """ruby
require "spec_helper"
RSpec.configure do |c|
@@ -122,7 +122,7 @@ Feature: anonymous controller
Scenario: invoke around filter in base class
Given a file named "spec/controllers/application_controller_around_filter_spec.rb" with:
- """
+ """ruby
require "spec_helper"
class ApplicationController < ActionController::Base
@@ -153,7 +153,7 @@ Feature: anonymous controller
Scenario: anonymous controllers only create resource routes
Given a file named "spec/controllers/application_controller_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe ApplicationController do
View
6 features/controller_specs/bypass_rescue.feature
@@ -9,7 +9,7 @@ Feature: bypass rescue
Background:
Given a file named "spec/controllers/gadgets_controller_spec_context.rb" with:
- """
+ """ruby
class AccessDenied < StandardError; end
class ApplicationController < ActionController::Base
@@ -25,7 +25,7 @@ Feature: bypass rescue
Scenario: standard exception handling using `rescue_from`
Given a file named "spec/controllers/gadgets_controller_spec.rb" with:
- """
+ """ruby
require "spec_helper"
require 'controllers/gadgets_controller_spec_context'
@@ -50,7 +50,7 @@ Feature: bypass rescue
Scenario: bypass `rescue_from` handling with `bypass_rescue`
Given a file named "spec/controllers/gadgets_controller_spec.rb" with:
- """
+ """ruby
require "spec_helper"
require 'controllers/gadgets_controller_spec_context'
View
4 features/controller_specs/controller_spec.feature
@@ -2,7 +2,7 @@ Feature: controller spec
Scenario: simple passing example
Given a file named "spec/controllers/widgets_controller_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe WidgetsController do
@@ -19,7 +19,7 @@ Feature: controller spec
Scenario: controller is exposed to global before hooks
Given a file named "spec/controllers/widgets_controller_spec.rb" with:
- """
+ """ruby
require "spec_helper"
RSpec.configure {|c| c.before { expect(controller).not_to be_nil }}
View
8 features/controller_specs/isolation_from_views.feature
@@ -9,7 +9,7 @@ Feature: views are stubbed by default
Scenario: expect template that is rendered by controller action (passes)
Given a file named "spec/controllers/widgets_controller_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe WidgetsController do
@@ -32,7 +32,7 @@ Feature: views are stubbed by default
Scenario: expect template that is not rendered by controller action (fails)
Given a file named "spec/controllers/widgets_controller_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe WidgetsController do
@@ -49,7 +49,7 @@ Feature: views are stubbed by default
Scenario: expect empty templates to render when view path is changed at runtime (passes)
Given a file named "spec/controllers/things_controller_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe ThingsController do
@@ -69,7 +69,7 @@ Feature: views are stubbed by default
Scenario: expect template to render the real template with render_views when view path is changed at runtime
Given a file named "spec/controllers/things_controller_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe ThingsController do
View
10 features/controller_specs/render_views.feature
@@ -5,7 +5,7 @@ Feature: render_views
Scenario: render_views directly in a single group
Given a file named "spec/controllers/widgets_controller_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe WidgetsController do
@@ -24,7 +24,7 @@ Feature: render_views
Scenario: render_views on and off in nested groups
Given a file named "spec/controllers/widgets_controller_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe WidgetsController do
@@ -73,7 +73,7 @@ Feature: render_views
"""
When I run `rspec spec --order default --format documentation`
Then the output should contain:
- """
+ """ruby
WidgetsController
with render_views
GET index
@@ -91,13 +91,13 @@ Feature: render_views
Scenario: render_views globally
Given a file named "spec/support/render_views.rb" with:
- """
+ """ruby
RSpec.configure do |config|
config.render_views
end
"""
And a file named "spec/controllers/widgets_controller_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe WidgetsController do
View
14 features/helper_specs/helper_spec.feature
@@ -15,7 +15,7 @@ Feature: helper spec
Scenario: helper method that returns a value
Given a file named "spec/helpers/application_helper_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe ApplicationHelper do
@@ -27,7 +27,7 @@ Feature: helper spec
end
"""
And a file named "app/helpers/application_helper.rb" with:
- """
+ """ruby
module ApplicationHelper
def page_title
"RSpec is your friend"
@@ -39,7 +39,7 @@ Feature: helper spec
Scenario: helper method that accesses an instance variable
Given a file named "spec/helpers/application_helper_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe ApplicationHelper do
@@ -52,7 +52,7 @@ Feature: helper spec
end
"""
And a file named "app/helpers/application_helper.rb" with:
- """
+ """ruby
module ApplicationHelper
def page_title
@title || nil
@@ -64,7 +64,7 @@ Feature: helper spec
Scenario: application helper is included in helper object
Given a file named "spec/helpers/widgets_helper_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe WidgetsHelper do
@@ -77,7 +77,7 @@ Feature: helper spec
end
"""
And a file named "app/helpers/application_helper.rb" with:
- """
+ """ruby
module ApplicationHelper
def app_name
"The App"
@@ -85,7 +85,7 @@ Feature: helper spec
end
"""
And a file named "app/helpers/widgets_helper.rb" with:
- """
+ """ruby
module WidgetsHelper
def widget_title
"#{app_name}: #{@title}"
View
8 features/mailer_specs/url_helpers.feature
@@ -2,11 +2,11 @@ Feature: URL helpers in mailer examples
Scenario: using URL helpers with default options
Given a file named "config/initializers/mailer_defaults.rb" with:
- """
+ """ruby
Rails.configuration.action_mailer.default_url_options = { :host => 'example.com' }
"""
And a file named "spec/mailers/notifications_spec.rb" with:
- """
+ """ruby
require 'spec_helper'
describe Notifications do
@@ -20,11 +20,11 @@ Feature: URL helpers in mailer examples
Scenario: using URL helpers without default options
Given a file named "config/initializers/mailer_defaults.rb" with:
- """
+ """ruby
# no default options
"""
And a file named "spec/mailers/notifications_spec.rb" with:
- """
+ """ruby
require 'spec_helper'
describe Notifications do
View
2 features/matchers/new_record_matcher.feature
@@ -8,7 +8,7 @@ Feature: be_a_new matcher
Scenario: example spec with four be_a_new possibilities
Given a file named "spec/models/widget_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe Widget do
View
2 features/matchers/redirect_to_matcher.feature
@@ -9,7 +9,7 @@ Feature: redirect_to matcher
Scenario: redirect_to with four possible options
Given a file named "spec/controllers/widgets_controller_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe WidgetsController do
View
2 features/matchers/relation_match_array.feature
@@ -6,7 +6,7 @@ Feature: ActiveRecord::Relation match array
Scenario: example spec with relation match_array matcher
Given a file named "spec/models/widget_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe Widget do
View
4 features/matchers/render_template_matcher.feature
@@ -11,7 +11,7 @@ Feature: render_template matcher
Scenario: render_template with three possible options
Given a file named "spec/controllers/gadgets_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe GadgetsController do
@@ -31,7 +31,7 @@ Feature: render_template matcher
Scenario: render_template in a view spec
Given a file named "spec/views/gadgets/index.html.erb_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "gadgets/index" do
View
12 features/mocks/mock_model.feature
@@ -13,7 +13,7 @@ Feature: mock_model
Scenario: passing a string that represents a non-existent constant
Given a file named "spec/models/car_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "mock_model('Car') with no Car constant in existence" do
@@ -41,7 +41,7 @@ Feature: mock_model
Scenario: passing a string that represents an existing constant
Given a file named "spec/models/widget_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe Widget do
@@ -56,7 +56,7 @@ Feature: mock_model
Scenario: passing a class that does not extend ActiveModel::Naming
Given a file named "spec/models/string_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe String do
@@ -70,7 +70,7 @@ Feature: mock_model
Scenario: passing an Active Record constant
Given a file named "spec/models/widget_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe Widget do
@@ -99,7 +99,7 @@ Feature: mock_model
Scenario: passing an Active Record constant with method stubs
Given a file named "spec/models/widget_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "mock_model(Widget) with stubs" do
@@ -132,7 +132,7 @@ Feature: mock_model
Scenario: mock_model outside rails
Given a file named "mock_model_outside_rails_spec.rb" with:
- """
+ """ruby
require 'rspec/rails/mocks'
describe "Foo" do
View
4 features/mocks/stub_model.feature
@@ -8,7 +8,7 @@ Feature: stub_model
Scenario: passing an Active Record constant with a hash of stubs
Given a file named "spec/models/widget_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "stub_model(Widget) with a hash of stubs" do
@@ -39,7 +39,7 @@ Feature: stub_model
Scenario: passing an Active Record constant with a block of stubs
Given a file named "spec/models/widget_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "stub_model(Widget) with a block of stubs" do
View
2 features/model_specs/errors_on.feature
@@ -2,7 +2,7 @@ Feature: errors_on
Scenario: with one validation error
Given a file named "spec/models/widget_spec.rb" with:
- """
+ """ruby
require "spec_helper"
class ValidatingWidget < ActiveRecord::Base
View
8 features/model_specs/transactional_examples.feature
@@ -7,7 +7,7 @@ Feature: transactional examples
Scenario: run in transactions (default)
Given a file named "spec/models/widget_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe Widget do
@@ -30,7 +30,7 @@ Feature: transactional examples
Scenario: run in transactions (explicit)
Given a file named "spec/models/widget_spec.rb" with:
- """
+ """ruby
require "spec_helper"
RSpec.configure do |c|
@@ -57,7 +57,7 @@ Feature: transactional examples
Scenario: disable transactions (explicit)
Given a file named "spec/models/widget_spec.rb" with:
- """
+ """ruby
require "spec_helper"
RSpec.configure do |c|
@@ -87,7 +87,7 @@ Feature: transactional examples
Scenario: run in transactions with fixture
Given a file named "spec/models/thing_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe Thing do
View
2 features/request_specs/request_spec.feature
@@ -25,7 +25,7 @@ Feature: request spec
Scenario: specify managing a Widget with Rails integration methods
Given a file named "spec/requests/widget_management_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "Widget management" do
View
10 features/routing_specs/be_routable_matcher.feature
@@ -6,7 +6,7 @@ Feature: be_routable matcher
Scenario: specify routeable route should not be routable (fails)
Given a file named "spec/routing/widgets_routing_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "routes for Widgets" do
@@ -21,7 +21,7 @@ Feature: be_routable matcher
Scenario: specify non-routeable route should not be routable (passes)
Given a file named "spec/routing/widgets_routing_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "routes for Widgets" do
@@ -36,7 +36,7 @@ Feature: be_routable matcher
Scenario: specify routeable route should be routable (passes)
Given a file named "spec/routing/widgets_routing_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "routes for Widgets" do
@@ -51,7 +51,7 @@ Feature: be_routable matcher
Scenario: specify non-routeable route should be routable (fails)
Given a file named "spec/routing/widgets_routing_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "routes for Widgets" do
@@ -66,7 +66,7 @@ Feature: be_routable matcher
Scenario: be_routable in a controller spec
Given a file named "spec/controllers/widgets_controller_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe WidgetsController do
View
2 features/routing_specs/named_routes.feature
@@ -4,7 +4,7 @@ Feature: named routes
Scenario: access named route
Given a file named "spec/routing/widget_routes_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "routes to the widgets controller" do
View
10 features/routing_specs/route_to_matcher.feature
@@ -12,7 +12,7 @@ Feature: route_to matcher
Scenario: passing route spec with shortcut syntax
Given a file named "spec/routing/widgets_routing_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "routes for Widgets" do
@@ -28,7 +28,7 @@ Feature: route_to matcher
Scenario: passing route spec with verbose syntax
Given a file named "spec/routing/widgets_routing_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "routes for Widgets" do
@@ -44,7 +44,7 @@ Feature: route_to matcher
Scenario: route spec for a route that doesn't exist (fails)
Given a file named "spec/routing/widgets_routing_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "routes for Widgets" do
@@ -59,7 +59,7 @@ Feature: route_to matcher
Scenario: route spec for a namespaced route with shortcut specifier
Given a file named "spec/routing/admin_routing_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "routes for Widgets" do
@@ -75,7 +75,7 @@ Feature: route_to matcher
Scenario: route spec for a namespaced route with verbose specifier
Given a file named "spec/routing/admin_routing_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "routes for Widgets" do
View
6 features/view_specs/inferred_controller_path.feature
@@ -2,7 +2,7 @@ Feature: view spec infers controller path and action
Scenario: infer controller path
Given a file named "spec/views/widgets/new.html.erb_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "widgets/new" do
@@ -17,7 +17,7 @@ Feature: view spec infers controller path and action
Scenario: infer action
Given a file named "spec/views/widgets/new.html.erb_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "widgets/new" do
@@ -31,7 +31,7 @@ Feature: view spec infers controller path and action
Scenario: do not infer action in a partial
Given a file named "spec/views/widgets/_form.html.erb_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "widgets/_form" do
View
4 features/view_specs/stub_template.feature
@@ -5,7 +5,7 @@ Feature: stub template
Scenario: stub template that does not exist
Given a file named "spec/views/gadgets/list.html.erb_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "gadgets/list" do
@@ -31,7 +31,7 @@ Feature: stub template
Scenario: stub template that exists
Given a file named "spec/views/gadgets/edit.html.erb_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "gadgets/edit" do
View
16 features/view_specs/view_spec.feature
@@ -4,7 +4,7 @@ Feature: view spec
Scenario: passing spec that renders the described view file
Given a file named "spec/views/widgets/index.html.erb_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "widgets/index" do
@@ -26,7 +26,7 @@ Feature: view spec
Scenario: passing spec with before and nesting
Given a file named "spec/views/widgets/index.html.erb_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "widgets/index" do
@@ -53,7 +53,7 @@ Feature: view spec
Scenario: passing spec with explicit template rendering
Given a file named "spec/views/widgets/widget.html.erb_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "rendering the widget template" do
@@ -75,7 +75,7 @@ Feature: view spec
Scenario: passing spec with rendering of locals in a partial
Given a file named "spec/views/widgets/_widget.html.erb_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "rendering locals in a partial" do
@@ -97,7 +97,7 @@ Feature: view spec
Scenario: passing spec with rendering of locals in an implicit partial
Given a file named "spec/views/widgets/_widget.html.erb_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "rendering locals in a partial" do
@@ -119,7 +119,7 @@ Feature: view spec
Scenario: passing spec with rendering of text
Given a file named "spec/views/widgets/direct.html.erb_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "rendering text directly" do
@@ -142,7 +142,7 @@ Feature: view spec
<%- end %>
"""
And a file named "spec/views/secrets/index.html.erb_spec.rb" with:
- """
+ """ruby
require 'spec_helper'
describe 'secrets/index' do
@@ -161,7 +161,7 @@ Feature: view spec
Scenario: request.path_parameters should match Rails by using symbols for keys
Given a file named "spec/views/widgets/index.html.erb_spec.rb" with:
- """
+ """ruby
require "spec_helper"
describe "controller.request.path_parameters" do

0 comments on commit 78b151a

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