Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spec2.cr isn't always executing (all) specs #55

Open
alexanderadam opened this issue Apr 8, 2017 · 4 comments
Open

spec2.cr isn't always executing (all) specs #55

alexanderadam opened this issue Apr 8, 2017 · 4 comments

Comments

@alexanderadam
Copy link

alexanderadam commented Apr 8, 2017

I don't have an example yet and I still have problems with macros and the codebase.
I will post more information if I know more.

At the moment I have a project where no specs are executed with $ crystal spec.

The console output is always empty.

Finished in 2.99 milliseconds
Examples: 0, failures: 0, pending: 0

If I add the path to a spec explicitly it is running.

So far I didn't found much. I saw that full_name always contained everything, so the error comes at a later point.

Maybe it's a naming thing? I will keep you updated.
I would appreciate it if you have an idea / fix / hint.

Edit: It seems that run_context is entered just once and it's given context has blank @what, blank @description and @_examples is nil.
So it looks like this:

run_context(
  #<Spec2::Reporters::Default:0x55ece4158ed0 @count=0, @pending=0, @errors=[], @output=#<Spec2::Outputs::Default:0x55ece4152fc0>>,
  #<Spec2::Orders::Default:0x55ece4152fd0>,
  #<Spec2::Context:0x55ece4156d40 @what="", @description="", @_contexts=nil, @_examples=nil, @_global_befores=[#<Proc(Nil):0x55ece1d698f0>]>)
@alexanderadam
Copy link
Author

hm, okay I give up. 😞
@waterlink, do you have any idea how I could debug 🐛 this?

@waterlink
Copy link
Owner

Can you send a code example? Ideally minimised?

@alexanderadam
Copy link
Author

No 😢 I will try to provide some in the following week.

@c910335
Copy link

c910335 commented Sep 14, 2017

It seems if an exception is accidentally raised outside it, specs after that will not be executed without any errors.

require "spec2"
  
Spec2.describe "Foo" do
  it "is foo~~~" do
    expect("foo~~~").to eq "foo~~~"
  end
end

raise "foo"

Spec2.describe "Boo" do
  it "is boo~~~" do
    expect("boo~~~").to eq "boo~~~"
  end
end
$ crystal spec
.

Finished in 0.31 milliseconds
Examples: 1, failures: 0, pending: 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants