The rspec homepage, unfortunately, does not talk about rspec initialization in your project.
Assuming you have a project folder called "bowling" in the bowling folder
rspec --init
This will create a specification directory and two files.
spec/spec_helper.rb
.rspec
The file .rspecallows you to define parameters such as color and format.
--color
--format documentation
Now in spec_helper.rbaddrequire "bowling"
require "bowling"
RSpec.configure do |config|
config.treat_symbols_as_metadata_keys_with_true_values = true
config.run_all_when_everything_filtered = true
config.filter_run :focus
config.order = 'random'
end
bowling_spec.rb `require 'spec_helper"
require "spec_helper"
class Bowling
def hit(pins)
end
def score
0
end
end
, , , require "spec_helper". spec_helper.rb , .
rspec
.