-
Notifications
You must be signed in to change notification settings - Fork 186
Developing FAQ
Michael Brandt edited this page Apr 4, 2021
·
6 revisions
docker-compose exec rack rspec spec/lib/x_spec.rb -e 'desc'
docker-compose exec rack rspec spec/lib/x_spec.rb:5:10
docker-compose exec rack rspec spec/lib/x_spec.rb:134
docker-compose exec rack rspec --only-failures
More RSpec CLI documentation: https://relishapp.com/rspec/rspec-core/docs/command-line
docker-compose exec rack rubocop -A # run with auto-correct, fixes most trivial issues
docker-compose exec rack rubocop -A lib/engine/game/meta.rb # run against specific file
docker-compose exec rack rubocop -A lib/engine/game/ # run against all files in a directory
More RuboCop CLI documentation: https://docs.rubocop.org/rubocop/usage/basic_usage.html#command-line-flags
Add a game json to spec/fixtures
and tests will run through it with the server-side engine code (https://github.com/tobymao/18xx/blob/master/spec/lib/engine/games/game_spec.rb#L12-L30).
You can also set up tests for the fixture at specific actions to verify game state. This is a useful way to debug by setting up breakpoints in a test right before the broken action and then step through the ruby code: https://github.com/tobymao/18xx/blob/master/spec/game_state_spec.rb
db_1 | chmod: changing permissions of '/var/lib/postgresql/data': Operation not permitted
db_1 | The files belonging to this database system will be owned by user "db".
db_1 | This user must also own the server process.
[…]
Try: chown -R [your_user] ./db