Comments (4)
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.
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.
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.
Fixed by 8d48e44
from spectator.
Related Issues (20)
- stub method(arg1,arg2,...) syntax seems to no longer work in 0.10/master HOT 3
- How to spec classes that contain class which shadow top-level primitives? HOT 4
- How to mock/stub IO::Memory#gets HOT 8
- Noticed line/column skew during incremental porting of RSpec files over to Spectator HOT 1
- Add RSpec's stub_const
- Better error when attempting to use string interpolation in it descriptions? HOT 11
- Problem with mock when using abstract class HOT 7
- Stubbed methods with default arguments not working HOT 3
- Mock not working for Process.run with block. HOT 10
- Runner filter -e tests equality instead of inclusion
- Example of custom matcher does not compile HOT 1
- Usage of keyword arguments as positional arguments in stubs HOT 1
- Mocks fail to compile for methods with free variables HOT 8
- Attempting to mock File results in error HOT 4
- Allow mocking libs
- Mocks on nameless splats HOT 2
- Re-run only failures HOT 1
- Segfault with nilable substring method call HOT 2
- `be_within` not respected during a `to have_received.with` check HOT 9
- subject with structs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spectator.