spec/client/account_spec.rb in travis-1.11.1 vs spec/client/account_spec.rb in travis-1.12.0

- old
+ new

@@ -1,32 +1,40 @@ +# frozen_string_literal: true + require 'spec_helper' describe Travis::Client::Account do - context "from all accounts" do - let(:session) { Travis::Client.new } + context 'with all accounts' do subject { session.accounts.first } - its(:name) { should be == 'Konstantin Haase' } - its(:login) { should be == 'rkh' } - its(:type) { should be == 'user' } - its(:repos_count) { should be == 200 } - its(:inspect) { should be == "#<Travis::Client::Account: rkh>" } - end - context "known account" do let(:session) { Travis::Client.new } - subject { session.account('rkh') } - its(:name) { should be == 'Konstantin Haase' } - its(:login) { should be == 'rkh' } - its(:type) { should be == 'user' } - its(:repos_count) { should be == 200 } - its(:inspect) { should be == "#<Travis::Client::Account: rkh>" } + + its(:name) { is_expected.to be == 'Konstantin Haase' } + its(:login) { is_expected.to be == 'rkh' } + its(:type) { is_expected.to be == 'user' } + its(:repos_count) { is_expected.to be == 200 } + its(:inspect) { is_expected.to be == '#<Travis::Client::Account: rkh>' } end - context "known account" do + context 'with known account' do + subject { session.account('rkh') } + let(:session) { Travis::Client.new } + + its(:name) { is_expected.to be == 'Konstantin Haase' } + its(:login) { is_expected.to be == 'rkh' } + its(:type) { is_expected.to be == 'user' } + its(:repos_count) { is_expected.to be == 200 } + its(:inspect) { is_expected.to be == '#<Travis::Client::Account: rkh>' } + end + + context 'with known account and nil name' do subject { session.account('foo') } - its(:name) { should be_nil } - its(:login) { should be == 'foo' } - its(:type) { should be_nil } - its(:inspect) { should be == "#<Travis::Client::Account: foo>" } + + let(:session) { Travis::Client.new } + + its(:name) { is_expected.to be_nil } + its(:login) { is_expected.to be == 'foo' } + its(:type) { is_expected.to be_nil } + its(:inspect) { is_expected.to be == '#<Travis::Client::Account: foo>' } end end