Coder Social home page Coder Social logo

Comments (6)

dchelimsky avatar dchelimsky commented on May 20, 2024

What do you mean "specify it by hand"?

from rspec-rails.

iain avatar iain commented on May 20, 2024

Like this:

describe UsersController, :type => :controller do
end

from rspec-rails.

dchelimsky avatar dchelimsky commented on May 20, 2024

You can get that like this now:

Rspec.configure do |c|
  c.include Foo, :example_group => {
    :describes => lambda {|described| described < ActionController::Base }
  }
end

Make sense?

from rspec-rails.

iain avatar iain commented on May 20, 2024

I can follow what you're doing. Is this a conscious design decision, or just a more global approach or workaround?

from rspec-rails.

dchelimsky avatar dchelimsky commented on May 20, 2024

rspec-2 is based on Micronaut, which is a complete re-write of the runner. This sort of filtering is built-in, so I'm hesitant to add other ways to do the same thing.

This will be well documented by the time we go 2.0.0-final, but there are a lot of other priorities right now.

I'll leave this open for now and we'll see how it goes.

from rspec-rails.

dchelimsky avatar dchelimsky commented on May 20, 2024

Add :type => :xxx to metadata for each specialized example group.

  • controller
  • helper
  • mailer
  • request
  • routing
  • view

This supports attaching behaviour to a subset of example groups in a
config block:

RSpec.configure do |c|
  before(:each, :type => :controller) do
    # do something
  end
end

Note that this is not mean you can attach controller spec behaviour to a
group like this:

DOES NOT WORK

describe "something", :type => :controller do

Closed by b3ab2bc.

from rspec-rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.