Skip to content

Commit

Permalink
Add subclass tests
Browse files Browse the repository at this point in the history
  • Loading branch information
coneybeare committed Aug 16, 2024
1 parent a035d2a commit 4893ede
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/ruby-enum/enum_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,18 @@ class SecondSubclass < FirstSubclass
it 'returns values' do
expect(Colors.values).to eq(%w[red green])
end

context 'when a subclass is defined' do
it 'returns all values' do
expect(FirstSubclass.values).to eq(%w[red green orange])
end
end

context 'when a subclass of a subclass is defined' do
it 'returns all values' do
expect(SecondSubclass.values).to eq(%w[red green orange pink])
end
end
end

describe '#to_h' do
Expand Down

0 comments on commit 4893ede

Please sign in to comment.