rspec-mocks
RSpec's 'test double' framework, with support for stubbing and mocking (by rspec)
rspec-core
RSpec runner and formatters (by rspec)
rspec-mocks | rspec-core | |
---|---|---|
2 | 6 | |
1,160 | 1,233 | |
- | - | |
7.5 | 8.6 | |
5 months ago | 5 months ago | |
Ruby | Ruby | |
MIT License | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
rspec-mocks
Posts with mentions or reviews of rspec-mocks.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-03-09.
- Relishapp is down, anyone knows what happened?
-
From Node to Ruby on Rails
It's nowhere near as equivalent, where's the behavior testing? Where stuff like allow_any_instance_of(...).to receive(...).and_return(...)? What about shared examples? How can you patch globally the current time?
Have a look on the examples here https://github.com/rspec/rspec-mocks
rspec-core
Posts with mentions or reviews of rspec-core.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-06-30.
-
Metaprogramming in Ruby: Advanced Level
That being said, the code and documentation for rspec is generally clear and descriptive, making it a fantastic repository for learning about metaprogramming techniques. In rspec-core/lib/rspec/core/dsl.rb, for example, the implementation is spelled out in code comments.
- Relishapp is down, anyone knows what happened?
-
Anyone have any good Ruby repos that showcase best practices?
Something like that. You almost certainly want to use bundler because it's pretty much the easiest way to add 3rd party libs to your app. (Read more about bundler). Tests aren't an absolute requirement but are a generally considered to be an important part of ruby (and rails) culture. They can be difficult to learn in the beginning, but get easier with practice -- start soon and practice often! (Good rule of thumb: test any public methods of your objects that you define, at a minimum -- a guide. There's also relishapp, which seems to be down at the moment?)
-
It's legos all the way down
Take this small excerpt[9] from rspec-core of the describe public api:
-
When not to use instance variables in RSpec
From what I understand RSpec creates a class per spec (e.g. #) and it stores the instance variables (defined in the before :context DSL) on the RSpec::Core::ExampleGroup class on class level. The RSpec::Core::ExampleGroup is the parent class of the spec classes.
From the RSpec docs
What are some alternatives?
When comparing rspec-mocks and rspec-core you can also consider the following projects:
haven - Self-hostable private blogging
ex_vec - re-creating rust's `vec!` macro in elixir
motor-admin-rails - Low-code Admin panel and Business intelligence Rails engine. No DSL - configurable from the UI. Rails Admin, Active Admin, Blazer modern alternative.
factory_bot - A library for setting up Ruby objects as test data.
Opal - Ruby ♥︎ JavaScript
Rustler - Safe Rust bridge for creating Erlang NIF functions