Code Monkey home page Code Monkey logo

Comments (4)

icy-arctic-fox avatar icy-arctic-fox commented on May 27, 2024 1

I'm surprised this worked before. In this syntax:

it is_expected.to be_nil

there's no block, and the macro code is asking for the filename and line number of the non-existent block. You're correct in that surrounding the test with braces would fix it, since that introduces a block.

it { is_expected.to be_nil }

There will be a fix for this shortly.

I had planned to deprecate the brace-less syntax in the next version of Spectator. However, I've seen quite a few people using this syntax and am having second thoughts. This syntax isn't supported in RSpec (for probably obvious reasons), but it can look quite elegant. What are your thoughts?

from spectator.

icy-arctic-fox avatar icy-arctic-fox commented on May 27, 2024 1

It seems that either something changed in the Crystal compiler (Nop used to have non-nil source values) or this broke in the last Spectator update, which aligns somewhat with the release of Crystal 0.36.0. This change switched from using __FILE__ and __LINE__, since they were unreliable in macros, to using the block's AST data. Do you know when this broke exactly? If I had to guess, it was the last version of Spectator that caused the issue. Either way, not too important, it's fixed now 😄

from spectator.

matthewmcgarvey avatar matthewmcgarvey commented on May 27, 2024

This is my first time using spectator so I'm probably not the best person to ask for an opinion about this shard.

My opinion would be to remove that style of spec. My first thought after tracking down the problem specs was that they probably never worked correctly but I think you're saying that they used to.

from spectator.

matthewmcgarvey avatar matthewmcgarvey commented on May 27, 2024

Fixed by 8d48e44

from spectator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.