[go: up one dir, main page]

`expect_raises` without arguments results in compiler error

The below block results in a compiler error:

it "fails" do
    expect_raises do
        raise "Error!"
    end
end

With compiler error:

...[snipped]
In lib/spectator/src/spectator/dsl/matchers.cr:794:16                                                                                                                                                                      
                                                                                                                                                                                                                  
 794 | expect {{block}}.to raise_error                                                                                                                                                                                                   
                ^----                                                                                                                                                                                                   
Error: undefined macro variable 'block'

Looks like &block should be an argument to the macro, or you can swap {{block}} with {{yield}}. I'd make a PR with these fixes but I'm not in a good spot to do that right now, so here's an issue :)

Thanks again for creating and maintaining spectator!