Skip to content

Instantly share code, notes, and snippets.

@ameseee
Last active June 26, 2024 16:54
Show Gist options
  • Save ameseee/037a9d2f9bfcd7beee85b528785c0c1c to your computer and use it in GitHub Desktop.
Save ameseee/037a9d2f9bfcd7beee85b528785c0c1c to your computer and use it in GitHub Desktop.
# mermaid_spec.rb
require 'rspec'
require './lib/mermaid'

describe Mermaid do
  it 'is an instance of mermaid' do
    mermaid = Mermaid.new('Sereia')
    expect(mermaid).to be_a Mermaid
  end

  it 'has a name' do
    mermaid = Mermaid.new('Sereia')
    expect(mermaid.name).to eq 'Sereia'
  end
  
  it 'has an age' do
    mermaid = Mermaid.new('Sereia')
    expect(mermaid.age).to eq 22
  end
  
  it 'has can get older' do
    mermaid = Mermaid.new('Sereia')
    mermaid.get_older
    expect(mermaid.age).to eq 23
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment