Quantcast
Channel: Disable a group of tests in rspec? - Stack Overflow
Viewing all articles
Browse latest Browse all 8

Disable a group of tests in rspec?

$
0
0

I have a test spec which describes a class and within that has various contexts each with various it blocks.

Is there a way I can disable a context temporarily?

I tried adding a pending "temporarily disabled" call at the very top within a context I want to disable, and I did see something about pending when I ran the spec but then it just continued to run the rest of the tests.

This is what I kind of had:

describe Something
  context "some tests" do
    it "should blah" do
      true
    end
  end

  context "some other tests" do
    pending "temporarily disabled"

    it "should do something destructive" do
      blah
    end
  end
end

but like I said it just went on to run the tests underneath the pending call.

Searching led me to this mailing list thread in which the the creator (?) of rspec says it's possible in rspec 2, which I'm running. I guess it did work but it didn't have the desired effect of disabling all of the following tests, which is what I think of when I see a pending call.

Is there an alternative or am I doing it wrong?


Viewing all articles
Browse latest Browse all 8

Latest Images

Trending Articles





Latest Images