waterlink / spec2.cr

Enhanced `spec` testing library for [Crystal](http://crystal-lang.org/).
MIT License
103 stars 22 forks source link

Feature request: Context Focus #34

Open marceloboeira opened 8 years ago

marceloboeira commented 8 years ago

It would be nice to be able to focus a specific context, if you have a big test suite, sometimes it boring to wait for the whole thing to finish.

describe Foo do
  context "when A" do
    it "do stuff" do
        ...
    end  
  end

  context "when B", focus: true do
    it "do other stuff" do
        ...
    end  
  end
end

Then, if focus is true, you run first that context, or even just that context.

@waterlink what do you think?

waterlink commented 7 years ago

@marceloboeira I think, we can do something like that. Also, it would be nice to have filtering capabilities, like rspec does: crystal spec -e 'hello world' and it will run only tests that have hello world in their description. Are you up for trying to make that happen? PoC or a pull request?

marceloboeira commented 7 years ago

@waterlink sorry for taking so long, lots of commitments lately. I will try to work on it next weekend, and I let you know of any progress.