We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 19d9749 commit 4af163fCopy full SHA for 4af163f
spec/ball_spec.rb
@@ -4,10 +4,15 @@
4
RSpec.describe Ball do
5
let(:answers) { YAML.load_file(File.join(__dir__, '../answers.yml')) }
6
7
- it 'prints the answer' do
8
- expect(STDOUT).to receive(:puts)
9
- subject.shake
10
- end
11
-
12
it { expect(answers).to include(subject.shake) }
+ it { expect(answers).to eql(Ball::ANSWERS) }
+
+ describe '#shake' do
+ before { stub_const('Ball::ANSWERS', ['ANSWER']) }
13
+ it 'prints colorized answer' do
14
+ expect(STDOUT).to receive(:puts).with("\e[31mANSWER\e[0m")
15
+ subject.shake
16
+ end
17
18
end
0 commit comments