- Use Minitest (not RSpec)
- System tests use Capybara with headless Chrome
- Test the public interface, not implementation details
- One assertion per behavior; avoid redundancy
- Test files mirror
app/structure undertest/ - Always use red/green TDD.
- Use cov-loupe CLI to inspect coverage reports. Run
bundle exec cov-loupe --helpto see available options. - All changes must preserve or restore
100%line coverage and
- Always use red/green TDD - Write tests before implementation.
- Use cov-loupe CLI to inspect coverage reports. Consult README.md for instructions on using cov-loupe.
- All changes must preserve or restore
100%line coverage and100%branch coverage by the end of the task. - After every change, once
bin/rails testis green, also runbin/rails test:systemand ensure it is green.
Implement a CLI game of Minesweeper using Ruby. Make sure to cover it with tests. The game should work by generating a minesweeper board, printing it and asking the user for the coordinates of the cell they wish to uncover. The board should be printed using the following notation: # for a still hidden field, 1-8 for a field with that many mines in the neighborhood, . for a field with no neighbors with mines and * for a mine. The program should correctly detect losing the game by hitting a mine and winning the game by uncovering all the fields without mines.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This is a little experiment in using Turbo Frames and Streams without Rails. | |
| # Built using just plain Sinatra as the web server. | |
| # | |
| # Make sure that you have sinatra and puma (or some other server) installed: | |
| # gem install sinatra | |
| # gem install puma | |
| # | |
| # You can then run the app with: | |
| # ruby app.rb | |
| require 'sinatra' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # == NOTE == | |
| # This gist is accompnaying a blog post on the topic: https://radanskoric.com/articles/understand-rails-async-db-queries | |
| require 'bundler/inline' | |
| require "benchmark" | |
| require "debug" | |
| require "uri" | |
| gemfile do | |
| source 'https://rubygems.org' |
I hereby claim:
- I am radanskoric on github.
- I am radan (https://keybase.io/radan) on keybase.
- I have a public key whose fingerprint is 41F2 EF64 3313 5FFB 1084 F96F 4F46 CCB4 AE6D D809
To claim this, I am signing this object: