-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathterminator_spec.rb
More file actions
64 lines (50 loc) · 1.53 KB
/
terminator_spec.rb
File metadata and controls
64 lines (50 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
require './spec_helper'
require "./terminator"
describe BadTerminator do
it "should destroy_john_connor" do
subject.destroy_john_connor!
subject.current_mission.should eq("destroy: john_connor")
end
it "should destroy_sarah_connor" do
subject.destroy_sarah_connor!
subject.current_mission.should eq("destroy: sarah_connor")
end
it 'should not protect john' do
expect(subject.protects?('John Connor')).to be_false
end
it 'should not protect Sarah' do
expect(subject.protects?('Sarah Connor')).to be_false
end
it 'should not protect Bob' do
expect(subject.protects?('Bob')).to be_false
puts 'poor bob'
end
it 'should not be good if it is trying to destory someone' do
subject.destroy_sarah_connor!
expect(subject.good?).to be_false
end
end
describe GoodTerminator do
it "should protect_john_connor" do
subject.protect_john_connor!
subject.current_mission.should eq("protect: john_connor")
end
it "should protect_sarah_connor" do
subject.protect_sarah_connor!
subject.current_mission.should eq("protect: sarah_connor")
end
it 'should protect john' do
expect(subject.protects?('John Connor')).to be_true
end
it 'should protect Sarah' do
expect(subject.protects?('Sarah Connor')).to be_true
end
it 'should not protect Bob' do
expect(subject.protects?('Bob')).to be_false
puts 'poor bob'
end
it 'should be good if it is not trying to destory someone' do
subject.protect_sarah_connor!
expect(subject.good?).to be_true
end
end