leonardo-bridge 0.4.3 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/LICENSE.txt +1 -1
- data/README.md +10 -7
- data/bin/leo-console +1 -0
- data/bin/leo-play +23 -4
- data/bridge.gemspec +2 -6
- data/lib/bridge.rb +2 -1
- data/lib/bridge/auction.rb +0 -1
- data/lib/bridge/board.rb +0 -1
- data/lib/bridge/call.rb +0 -1
- data/lib/bridge/contract.rb +0 -3
- data/lib/bridge/deal.rb +9 -6
- data/lib/bridge/deck.rb +13 -2
- data/lib/bridge/game.rb +55 -7
- data/lib/bridge/hand.rb +1 -1
- data/lib/bridge/player.rb +1 -3
- data/lib/bridge/result.rb +5 -5
- data/lib/bridge/trick_play.rb +0 -1
- data/lib/bridge/version.rb +1 -1
- data/spec/auction_spec.rb +23 -23
- data/spec/board_spec.rb +8 -8
- data/spec/bridge_spec.rb +16 -16
- data/spec/call_spec.rb +19 -19
- data/spec/card_spec.rb +21 -21
- data/spec/deck_spec.rb +2 -2
- data/spec/enum_spec.rb +7 -7
- data/spec/game_spec.rb +169 -85
- data/spec/hand_spec.rb +3 -3
- data/spec/player_spec.rb +3 -3
- data/spec/result_spec.rb +5 -5
- data/spec/spec_helper.rb +0 -7
- data/spec/support/auction_helper.rb +3 -3
- data/spec/trick_play_spec.rb +44 -45
- data/spec/trick_spec.rb +4 -4
- metadata +18 -83
- data/lib/bridge/db.rb +0 -27
- data/lib/redis_model.rb +0 -137
- data/lib/uuid.rb +0 -280
- data/spec/db_spec.rb +0 -19
- data/spec/redis_model_spec.rb +0 -50
- data/spec/support/test_model.rb +0 -3
data/spec/redis_model_spec.rb
DELETED
@@ -1,50 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe RedisModel do
|
4
|
-
subject { RedisModel.new }
|
5
|
-
|
6
|
-
describe '#persist!' do
|
7
|
-
before { subject.persist! }
|
8
|
-
it { subject.id.should eq(1) }
|
9
|
-
it "should not alter existing id" do
|
10
|
-
subject.persist!
|
11
|
-
subject.id.should eq(1)
|
12
|
-
end
|
13
|
-
it { $redis.hgetall(subject.id).should be_a(Hash) }
|
14
|
-
end
|
15
|
-
|
16
|
-
describe '#load' do
|
17
|
-
before { subject.persist! }
|
18
|
-
|
19
|
-
it { RedisModel.load(subject.id).should be_a(RedisModel) }
|
20
|
-
it { RedisModel.load(subject.id).should eq(subject) }
|
21
|
-
|
22
|
-
it 'should have_timestamps disabled by default' do
|
23
|
-
expect { subject.created_at }.to raise_error
|
24
|
-
expect { subject.updated_at }.to raise_error
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
describe '#all' do
|
29
|
-
before { 5.times { RedisModel.new.persist! } }
|
30
|
-
subject { RedisModel }
|
31
|
-
|
32
|
-
it { subject.all.should be_a(Array) }
|
33
|
-
it { subject.all.size.should eq(5) }
|
34
|
-
end
|
35
|
-
|
36
|
-
describe 'descendant classes' do
|
37
|
-
subject { TestModel.new }
|
38
|
-
|
39
|
-
before { subject.persist! }
|
40
|
-
|
41
|
-
it 'should have_timestamps' do
|
42
|
-
expect { subject.created_at }.to_not raise_error
|
43
|
-
expect { subject.updated_at }.to_not raise_error
|
44
|
-
end
|
45
|
-
it { subject.created_at.should_not eq(nil) }
|
46
|
-
it { subject.updated_at.should_not eq(nil) }
|
47
|
-
|
48
|
-
it { TestModel.load(subject.id).id.should eq(subject.id) }
|
49
|
-
end
|
50
|
-
end
|
data/spec/support/test_model.rb
DELETED