This is how to test with RSpec
This page was formatted via http://alexgorbatchev.com/SyntaxHighlighter/
Go into your shell and setup your environment.
$ mkdir my-testing-project/
$ rspec --init
Make your files, name your test file with a '_spec' suffix or rspec will hate you.
$ touch lib/app.rb
$ touch spec/tester_spec.rb
Open your tester.rb
require 'app'
RSpec.describe(Class) do
## these look vaguely like english thats why
it("should existy probably") do
expect(Hangman.new).to(be_a(Hangman))
end
end
Take a break, when you are done go into your app directory shell and run the following:
$ rspec
No comments:
Post a Comment