luckyframework / luckyframework/lucky_flow

Consider switching to Spectator

Open
#115 4 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Crystal
Stars
55
Forks
9
PR merge metrics
No merged PRs in 30d

Description

So at the panel discussion @matthewmcgarvey [mentioned that he would love to have mocking and additional features available in specs](https://youtu.be/iOUPRIsVuuc?list=PLfpFq_WLOW__RIIyWvTgYV4bw2cpav2mJ&t=1756).
I guess by "missing" he meant in reference to RSpec.

Luckily (!), @icy-arctic-fox wrote [Spectator](https://gitlab.com/arctic-fox/spectator), which is a testing framework based on RSpec (> 3).
It has [an incredible amount of RSpec features](https://gitlab.com/arctic-fox/spectator#feature-progress) already available.

I guess one of the main decisions whether to switch from an stdlib testing library to an external one, is usually the amount of dependencies but in Lucky's case we are talking about a fully fledged web framework that should allow developers to develop apps as secure, convenient and fast as possible. If someone is looking for a solution that's as tiny as possible, Lucky might not be the optimal choice. There are other tiny web frameworks in Crystal that are focussing on that.

Thus, while the standard Crystal spec is functional and [_intentionally_ kept tiny](https://github.com/crystal-lang/crystal/issues/8289#issuecomment-541580876), this doesn't mean that Lucky has to stuck with it.
Ruby's RSpec is also not the standard test library in Ruby but it is yet one of the ([or the](https://infinum.com/the-capsized-eight/analyzing-rubygems-stats-v2016#:~:text=RSpec%20-%20The%20New%20King%20of%20Testing)?) most popular test library.

Also Matthew is most likely not the only web dev who's missing convenient test features that would be solved by switching to Spectator (see [_here_](https://github.com/crystal-lang/crystal/issues/687), [_here_](https://github.com/porras/mock), [_here_](https://github.com/waterlink/mocks.cr) or various comments in [_this issue_](https://github.com/crystal-lang/crystal/issues/8289)). Which is absolutely understandable, since tests/specs are giving security and allow us to develop better applications that are as stable as possible.

**PS:** Also using the non-intrusive expect syntax might be an advantage.
**PPS:** I absolutely understand that this might be a hot topic but I'm sure it it much better to have this discussion at this point than at a much later point where a full developed ecosystem might have been evolved that would make it even harder to switch. I guess a (slow) migration at this point might still be a realistic option and Lucky's users would gain a lot.
**PPPS:** Thank you so much for Lucky. :pray: Really. Lucky is wonderful!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing Crystal spec setup and the linked Spectator feature progress. Determine whether Lucky should adopt Spectator and define a migration path; done would mean a decided framework choice and an agreed migration scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
crystal
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.