rockstar
factory_bot
Our great sponsors
rockstar | factory_bot | |
---|---|---|
189 | 29 | |
6,864 | 7,868 | |
0.1% | 0.0% | |
5.6 | 7.7 | |
8 days ago | 3 days ago | |
JavaScript | Ruby | |
MIT License | MIT License |
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.
rockstar
-
Attempting each AOC in a language starting with each letter of the alphabet
what about using https://codewithrockstar.com/
- Is it worth it to learn it?
-
My friend likes to be "creative" with variable names
You should just port your codebase to Rockstar at this point. https://codewithrockstar.com/
- What do you guys think should I suggest him to learn as their first programming language?
-
what in the gods name
Rockstar
-
What are you working on? (2022-12)
I've also decided to start work on a Rockstar interpreter, for shiggles. I'm still looking for resources on implementing interpreters in F#.
-
-🎄- 2022 Day 1 Solutions -🎄-
If you are looking for resources to get started, I used this interpreter: https://codewithrockstar.com/ and the docs here: https://codewithrockstar.com/docs
See http://codewithrockstar.com/ - it's a very expressive language! I'm not sure I am quite in the groove yet, but it's only day 1...
- Elon's code quality standards I guess...
- Can you guess those ten languages? 🤡
factory_bot
-
Metaprogramming in Ruby: Advanced Level
factory_bot: A fixtures replacement
-
Seeding the DB: Best approach?
Not sure if you want the execution speed to be faster, or the development speed. If it's development, you can use FactoryBot in a script to generate data easily once you have your factories set up.
-
How to optimize factory creation.
The factory-bot gem is used in almost in all of our spec files and it make our set up much more easier than when we use fixtures. Here is the tradeoff, the easier the gem is to use, the more likely you’ll end up with some pain to control its usage. And when the times come to tackle slow tests, the best bet you can take is to start digging into you factories because it’s likely they are the primary reason why your test suite is slowing down
-
Efate Test Generator Series: Extending the library
Efate is actually the second test fixture library I've written and there were several lessons I learned after using the first iteration for several years myself. The first version was influenced a great deal by factor_girl (called factory_bot now), with a heavy dependency on strings to define and create the fixtures. It also wasn't very modular. You couldn't just import a specific fixture, you had to bring in the whole library. And it wasn't very extensible, if you needed to define custom behavior for how a field should be created, it wasn't very pretty.
-
Get help from thoughtbot for free (mentoring / office hours)
I work at thoughtbot, you might know us for our open source work like administrate, factory_bot or shoulda-matchers.
-
Gnarly Learnings From June 2022
As we continue to level-up our skillsets as developers in Rails, the utility of POROs (Plain Old Ruby Objects) becomes more apparent and appealing. Sometimes, the business object(s) you create do not require persistent storage to a database and are, therefore, outside of the scope of an ORM (Object Relational Mapper) like ActiveRecord. But how do we maintain simplicity in our test suite and continue to leverage helpful testing libraries like FactoryBot without one? This instructional article explores how to implement factories for POROs including common pitfalls, building nested resources, and factory linting.
-
Test Data Factories in Javascript
In the ruby world I'm a fan of factory_bot for generating objects that will serve as test data in my unit tests. I had a bit of time to kill this evening and thought it would be fun to implement the subset of the functionality that I use in factory_bot in javascript to see how I would approach it.
-
`method_missing': undefined method `has_paper_trail'
redd@tanya:~/galaxy$ rails s [DEPRECATED] Bootsnap's `autoload_paths_cache:` option is deprecated and will be removed. If you use Zeitwerk this option is useless, and if you are still using the classic autoloader upgrading is recommended. [DEPRECATED] Bootsnap's `disable_trace:` option is deprecated and will be removed. If you use Ruby 2.5 or newer this option is useless, if not upgrading is recommended. DEPRECATION WARNING: The factory_girl gem is deprecated. Please upgrade to factory_bot. See https://github.com/thoughtbot/factory_bot/blob/v4.9.0/UPGRADE_FROM_FACTORY_GIRL.md for further instructions. (called from at /home/redd/galaxy/config/application.rb:9) => Booting Puma => Rails 5.2.7 application starting in development => Run `rails server -h` for more startup options /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activerecord-5.2.7/lib/active_record/type.rb:27: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activerecord-5.2.7/lib/active_record/type/adapter_specific_registry.rb:9: warning: The called method `add_modifier' is defined here /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activemodel-5.2.7/lib/active_model/type/integer.rb:13: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activemodel-5.2.7/lib/active_model/type/value.rb:8: warning: The called method `initialize' is defined here /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activerecord-5.2.7/lib/active_record/connection_adapters/postgresql/oid/specialized_string.rb:12: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activemodel-5.2.7/lib/active_model/type/value.rb:8: warning: The called method `initialize' is defined here Exiting Traceback (most recent call last): 120: from bin/rails:3:in `' 119: from bin/rails:3:in `load' .... 8: from /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-5.2.7/lib/active_support/dependencies.rb:661:in `new_constants_in' 7: from /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-5.2.7/lib/active_support/dependencies.rb:476:in `block in load_file' 6: from /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:39:in `load' 5: from /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:39:in `load' 4: from /home/redd/galaxy/app/models/users/user.rb:1:in `' 3: from /home/redd/galaxy/app/models/users/user.rb:2:in `' 2: from /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/attr_encrypted-3.1.0/lib/attr_encrypted/adapters/active_record.rb:131:in `method_missing_with_attr_encrypted' 1: from /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/attr_encrypted-3.1.0/lib/attr_encrypted.rb:306:in `method_missing' /home/redd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activerecord-5.2.7/lib/active_record/dynamic_matchers.rb:22:in `method_missing': undefined method `has_paper_trail' for # (NoMethodError) Did you mean? has_attached_file
- Five Easy to Miss PostgreSQL Query Performance Bottlenecks
-
It really be like that though
Here is an example from Factory Bot itself, which includes embedded Ruby (in this case):
What are some alternatives?
Fabrication - This project has moved to GitLab! Please check there for the latest updates.
faker - A library for generating fake data such as names, addresses, and phone numbers.
ffaker - Faker refactored.
Machinist - Fixtures aren't fun. Machinist is.
Forgery - Easy and customizable generation of forged data.
FactoryTrace - Simple tool to maintain factories and traits from FactoryBot
Fake Person - Create some fake personalities
TapReportParser - TAP Report Parser
OpenBBTerminal - Investment Research for Everyone, Everywhere.
PaperTrail - Track changes to your rails models
Ruby Tests Profiling Toolbox - Ruby Tests Profiling Toolbox
turbo_tests - Run RSpec tests on multiple cores. Like parallel_tests but with incremental summarized output. Originally extracted from the Discourse and Rubygems source code.