Sha256: 91e76f4c1e0beb60d07d7dadd0b443bdb9fb1e463ffda28e8f1553cd0e4be52c
Contents?: true
Size: 855 Bytes
Versions: 19
Compression:
Stored size: 855 Bytes
Contents
# frozen_string_literal: true require 'spec_helper' describe Arstotzka do describe 'default option' do subject(:star_gazer) do StarGazer.new(hash).favorite_star end let(:hash) { {} } context 'when node is not found' do it 'returns the default before wrapping' do expect(star_gazer.name).to eq('Sun') end it 'wraps the returned value in a class' do expect(star_gazer).to be_a(Star) end end context 'when node is not missing' do let(:hash) do { universe: { star: { name: 'Antares' } } } end it 'returns the value before wrapping' do expect(star_gazer.name).to eq('Antares') end it 'wraps the returned value in a class' do expect(star_gazer).to be_a(Star) end end end end
Version data entries
19 entries across 19 versions & 1 rubygems