Skip to content

Instantly share code, notes, and snippets.

View dchelimsky's full-sized avatar

David Chelimsky dchelimsky

  • Retired
  • Chicago, IL, USA
View GitHub Profile
# dependencies are generated using a strict version, don't forget to edit the dependency versions when upgrading.
merb_gems_version = "1.0.8.1"
# For more information about each component, please read http://wiki.merbivore.com/faqs/merb_components
dependency "merb-action-args", merb_gems_version
dependency "merb-assets", merb_gems_version
dependency "merb-cache", merb_gems_version
dependency "merb-helpers", merb_gems_version
dependency "merb-mailer", merb_gems_version
dependency "merb-slices", merb_gems_version
#!/usr/bin/env ruby
#
# This file was generated by RubyGems.
#
# The application 'cucumber' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'rubygems'
$:.unshift 'vendor/gems/cucumber-0.1.6/lib'
class ThingsController < ApplicationController
class UnRescuedError < StandardError; end
class RescuedError < StandardError; end
rescue_from RescuedError do |exception|
#no-op
end
def action_that_raises_rescued_error
raise RescuedError
require File.dirname(__FILE__) + '/../../../spec_helper'
require 'controller_spec_controller'
['integration', 'isolation'].each do |mode|
describe "A controller example running in #{mode} mode", :type => :controller do
controller_name :controller_spec
integrate_views if mode == 'integration'
describe "with an error that is not rescued in the controller" do
context "without rails' error handling" do
<%=h status %>
<% content_for :footer %>
<%=h footer %>
<% end %>
_rspec_opts = _ruby_opts.dup
_rspec_opts.delete(:aka)
_rspec_opts[:keywords].concat %w{
context describe example it share_as shared_examples_for
simple_matcher specify
}
FORMATTERS.for('rspec', _rspec_opts)
Spec::Matchers.create :be_a_multiple_of do |actual, expected|
match do
actual % expected == 0
end
end
describe 15 do
it { should be_a_multiple_of(5) }
end
class Thing < ActiveRecord::Base
validates_presence_of :name
end
describe ProjectsController do
describe :get => :show, :id => '37' do
expects :find, :on => Project, :with => { :id => '37' }, :returns => mock_project
assigns :project
describe "mime XML" do
mime Mime::XML
#
end
end
describe Admin::BaseController do
subject do
klass = Class.new(Admin::BaseController) {def index; end}
self.class.const_set(generate_name, klass)
klass.new
end
end