spec/daigaku/congratulator_spec.rb in daigaku-0.3.0 vs spec/daigaku/congratulator_spec.rb in daigaku-0.4.0

- old
+ new

@@ -1,24 +1,27 @@ require 'spec_helper' describe Daigaku::Congratulator do - - it "responds to #message" do + it 'responds to #message' do expect(Daigaku::Congratulator).to respond_to :message end - describe "#message" do - it "returns a string" do + describe '#message' do + it 'returns a string' do expect(Daigaku::Congratulator.message).to be_a String end - it "returns a random congratulation method" do - messages = 1.upto(10).map { |i| Daigaku::Congratulator.message } + it 'returns a random congratulation method' do + messages = 1.upto(10).map { |_| Daigaku::Congratulator.message } expect(messages.uniq.count).to be > 1 end - it "receives the congratulation texts from a Terminal text" do - expect(Daigaku::Terminal).to receive(:text).with(:congratulations) { '' } + it 'receives the congratulation texts from a Terminal text' do + expect(Daigaku::Terminal) + .to receive(:text) + .with(:congratulations) + .and_return('') + Daigaku::Congratulator.message end end end