Sha256: 6f3f116811bc0852adf0377b99f3c9d3961f9167442449ef00e9450ddd112aa3
Contents?: true
Size: 586 Bytes
Versions: 17
Compression:
Stored size: 586 Bytes
Contents
require 'spec_helper' describe Symbol do describe '#to_s' do it{ expect(:x.to_s).to eq('x') } end describe '#differentiate' do it{ expect(:x.d(:x).to_s).to eq('1') } end describe 'Calculate' do context 'With Fixnum' do it{ expect(:x + 0).to eq(:x) } it{ expect(:x - 0).to eq(:x) } it{ expect((:x * 0).to_s).to eq('0') } it{ expect(:x * 1).to eq(:x) } it{ expect{(:x / 0).to_s}.to raise_error(ZeroDivisionError) } it{ expect(:x / 1).to eq(:x) } it{ expect((:x ^ 0).to_s).to eq('1') } it{ expect(:x ^ 1).to eq(:x) } end end end
Version data entries
17 entries across 17 versions & 1 rubygems