Created
April 15, 2020 20:51
-
-
Save RickArora/24bf64581f1b86edcf65f43df55cd339 to your computer and use it in GitHub Desktop.
This file contains 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
require 'plays' | |
describe Play do | |
describe 'find by titile' do | |
it 'returns the Play matching the given title' do | |
expect(Play.new.find_by_title('All My Sons').year).to eq(1947) | |
end | |
end | |
end | |
# failing test | |
bundle exec rspec | |
F | |
Failures: | |
1) Play find by titile returns the Play matching the given title | |
Failure/Error: | |
def initialize(options) | |
@id = options['id'] | |
@title = options['title'] | |
@year = options['year'] | |
@playwright_id = options['playwright_id'] | |
end | |
ArgumentError: | |
wrong number of arguments (given 0, expected 1) | |
# ./lib/plays.rb:22:in `initialize' | |
# ./spec/plays_spec.rb:6:in `new' | |
# ./spec/plays_spec.rb:6:in `block (3 levels) in <top (required)>' | |
Finished in 0.00414 seconds (files took 0.18268 seconds to load) | |
1 example, 1 failure | |
Failed examples: | |
rspec ./spec/plays_spec.rb:5 # Play find by titile returns the Play matching the given title | |
# test below | |
require 'plays' | |
describe Play do | |
describe 'find by titile' do | |
it 'returns the Play matching the given title' do | |
expect(Play.new.find_by_title('All My Sons').year).to eq(1947) | |
end | |
end | |
end | |
#repo: https://github.com/RickArora/Postgres/tree/master/Plays-Playwrights%20ORM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment