espec icon indicating copy to clipboard operation
espec copied to clipboard

nicer mech integration

Open benmmurphy opened this issue 13 years ago • 0 comments

we should have a thing that just automatically unloads all the mechs you have defined in a before or in an example.

for example

describe("foo", fun() ->
  before_each(fun() ->
    %load mech 1
  end),

  it("should do stuff", fun() ->
  end),

  describe("nested", fun() ->
    before_each(fun() ->
      % load mech 2
    end),
    it("should do more stuff", fun() ->
    end),
  end)
end)

is converted to

load mech 1 run "should do stuff" unload mech 1

load mech 1 load mech 2 run "should do more stuff" unload mech 2 unload mech 1

we should probably provide an option to auto-verify as well.

not sure if mech already has something to make this easy...

benmmurphy avatar Dec 26 '11 14:12 benmmurphy