the beginning • I took over May 2013 • 5833 lines of RSpec tests As of Thursday we have 5750 lines of tests, but we ripped out a bunch of complex systems.
0) } ! it 'comes to life appropriately' it 'stays alive appropriately’ ! it 'counts neighbors' do expect(subject.neighbors).to eq 0 ! c2 = described_class.new(1, 0) expect(subject.neighbors).to eq 1 end end Spec group Skeletons Spec Expectation
:model do subject{ described_class.create } ! it 'has many comments' do expect(subject.comments).to be_empty c = Comment.create post: subject expect(subject.comments).to_not be_empty end end
! describe 'counters' do subject { Riak::Crdt::Counter.new bucket, random_key } ! it 'asks for and accepts a returned body' do other = Riak::Crdt::Counter.new(subject.bucket, subject.key) end end end
INITIALIZED" end end ! describe Turn do let(:turn){ Turn.new } ! it "might not get initialized" do expect(5).to eq 5 end ! it "is only initialized on use" do expect(turn).to be_a Turn end end
security enabled on Riak', no_security: true do it 'connects normally without authentication configured' do … ! describe 'with security enabled on Riak', yes_security: true do it 'connects normally with authentication configured' do These tests are mutually exclusive; they require server settings to be toggled and local configuration settings to match. I use tags to control which set runs.