Permalink
Browse files

Identify ruby code for syntax highlighting

Fixes #617
  • Loading branch information...
vanstee
vanstee committed Oct 12, 2012
1 parent 1dd534b commit 78b151a8f3fb2fd49c72b4fa7d1b0f8a517b8b36
@@ -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
@@ -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'
@@ -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 }}
@@ -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
@@ -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
@@ -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,15 +77,15 @@ Feature: helper spec
end
"""
And a file named "app/helpers/application_helper.rb" with:
- """
+ """ruby
module ApplicationHelper
def app_name
"The App"
end
end
"""
And a file named "app/helpers/widgets_helper.rb" with:
- """
+ """ruby
module WidgetsHelper
def widget_title
"#{app_name}: #{@title}"
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
Oops, something went wrong.

0 comments on commit 78b151a

Please sign in to comment.