Advertisement
Guest User

Untitled

a guest
Aug 16th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.69 KB | None | 0 0
  1. require 'rspec'
  2. require_relative '../lib/disc'
  3. require_relative '../lib/product'
  4.  
  5. describe 'Disc' do
  6.   #class Disc < Product; end
  7.  
  8.   file_path = File.dirname(__FILE__) + '/fixtures/1.txt'
  9.   disc = Disc.from_file(file_path)
  10.  
  11.   context 'disc methods' do
  12.     it "check disc init attributes" do
  13.       expect(disc).to have_attributes(:title => "Painkiller")
  14.       expect(disc).to have_attributes(:author => "Judas Priest")
  15.       expect(disc).to have_attributes(:genre => "Heavy Metal")
  16.       expect(disc).to have_attributes(:year => "1990".to_i )
  17.       expect(disc).to have_attributes(:price => "990".to_i )
  18.       expect(disc).to have_attributes(:quantity => "3".to_i )
  19.     end
  20.   end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement