chess_vwong 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/spec/player_spec.rb CHANGED
@@ -1,21 +1,19 @@
1
- require "spec_helper"
1
+ require 'spec_helper'
2
2
 
3
3
  module ChessVwong
4
- describe Player do
5
-
6
- context "#color" do
7
- it "returns color" do
8
- player = Player.new("Van Damme", "w")
9
- expect(player.color).to eq "w"
4
+ describe Player do
5
+ context '#color' do
6
+ it 'returns color' do
7
+ player = Player.new('Van Damme', 'w')
8
+ expect(player.color).to eq 'w'
10
9
  end
11
10
  end
12
11
 
13
- context "#name" do
14
- it "returns name" do
15
- player = Player.new("Van Damme", "w")
16
- expect(player.name).to eq "Van Damme"
12
+ context '#name' do
13
+ it 'returns name' do
14
+ player = Player.new('Van Damme', 'w')
15
+ expect(player.name).to eq 'Van Damme'
17
16
  end
18
17
  end
19
-
20
18
  end
21
- end
19
+ end
data/spec/queen_spec.rb CHANGED
@@ -1,50 +1,47 @@
1
- require "spec_helper"
1
+ require 'spec_helper'
2
2
 
3
3
  module ChessVwong
4
- describe Queen do
5
- let (:current_space) { [1,1]}
6
- let (:queen) { Queen.new(current_space,"w")}
7
- context "#initialize" do
8
- it "should return Piece attributes: color" do
9
- expect(queen.color).to eq "w"
4
+ describe Queen do
5
+ let (:current_space) { [1, 1] }
6
+ let (:queen) { Queen.new(current_space, 'w') }
7
+ context '#initialize' do
8
+ it 'should return Piece attributes: color' do
9
+ expect(queen.color).to eq 'w'
10
10
  end
11
11
 
12
- it "should return Piece attributes: current_space" do
12
+ it 'should return Piece attributes: current_space' do
13
13
  expect(queen.current_space).to eq current_space
14
14
  end
15
15
  end
16
16
 
17
- context "#character" do
18
- it "should return a white queen character" do
19
- expect(queen.character).to eq "\u{265B}"
17
+ context '#character' do
18
+ it 'should return a white queen character' do
19
+ expect(queen.character).to eq "\u{2655}"
20
20
  end
21
21
 
22
- it "should return a black queen character" do
23
- queen_2 = Queen.new(current_space,"b")
24
- expect(queen_2.character).to eq "\u{2655}"
25
- end
26
- end
22
+ it 'should return a black queen character' do
23
+ queen_2 = Queen.new(current_space, 'b')
24
+ expect(queen_2.character).to eq "\u{265B}"
25
+ end
26
+ end
27
27
 
28
- context "#generate_neighbours" do
29
- it "should return only 21 neighbour when [1,1]" do
28
+ context '#generate_neighbours' do
29
+ it 'should return only 21 neighbour when [1,1]' do
30
30
  queen.generate_neighbours(current_space)
31
31
  expect(queen.neighbours.count).to eq 21
32
32
  end
33
33
 
34
- it "should return only 21 neighbour when [8,8]" do
35
- current_space = [8,8]
34
+ it 'should return only 21 neighbour when [8,8]' do
35
+ current_space = [8, 8]
36
36
  queen.generate_neighbours(current_space)
37
37
  expect(queen.neighbours.count).to eq 21
38
38
  end
39
39
 
40
- it "should return only 14 neighbour when in the middle" do
41
- current_space = [4,4]
40
+ it 'should return only 14 neighbour when in the middle' do
41
+ current_space = [4, 4]
42
42
  queen.generate_neighbours(current_space)
43
43
  expect(queen.neighbours.count).to eq 27
44
- end
45
-
44
+ end
46
45
  end
47
-
48
-
49
46
  end
50
- end
47
+ end
data/spec/rook_spec.rb CHANGED
@@ -1,50 +1,47 @@
1
- require "spec_helper"
1
+ require 'spec_helper'
2
2
 
3
3
  module ChessVwong
4
- describe Rook do
5
- let (:current_space) { [1,1]}
6
- let (:rook) { Rook.new(current_space,"w")}
7
- context "#initialize" do
8
- it "should return Piece attributes: color" do
9
- expect(rook.color).to eq "w"
4
+ describe Rook do
5
+ let (:current_space) { [1, 1] }
6
+ let (:rook) { Rook.new(current_space, 'w') }
7
+ context '#initialize' do
8
+ it 'should return Piece attributes: color' do
9
+ expect(rook.color).to eq 'w'
10
10
  end
11
11
 
12
- it "should return Piece attributes: current_space" do
12
+ it 'should return Piece attributes: current_space' do
13
13
  expect(rook.current_space).to eq current_space
14
14
  end
15
15
  end
16
16
 
17
- context "#character" do
18
- it "should return a white rook character" do
19
- expect(rook.character).to eq "\u{265C}"
17
+ context '#character' do
18
+ it 'should return a white rook character' do
19
+ expect(rook.character).to eq "\u{2656}"
20
20
  end
21
21
 
22
- it "should return a black rook character" do
23
- rook_2 = Rook.new(current_space,"b")
24
- expect(rook_2.character).to eq "\u{2656}"
25
- end
26
- end
22
+ it 'should return a black rook character' do
23
+ rook_2 = Rook.new(current_space, 'b')
24
+ expect(rook_2.character).to eq "\u{265C}"
25
+ end
26
+ end
27
27
 
28
- context "#generate_neighbours" do
29
- it "should return only 14 neighbour when [1,1]" do
28
+ context '#generate_neighbours' do
29
+ it 'should return only 14 neighbour when [1,1]' do
30
30
  rook.generate_neighbours(current_space)
31
31
  expect(rook.neighbours.count).to eq 14
32
32
  end
33
33
 
34
- it "should return only 14 neighbour when [8,8]" do
35
- current_space = [8,8]
34
+ it 'should return only 14 neighbour when [8,8]' do
35
+ current_space = [8, 8]
36
36
  rook.generate_neighbours(current_space)
37
37
  expect(rook.neighbours.count).to eq 14
38
38
  end
39
39
 
40
- it "should return only 14 neighbour when in the middle" do
41
- current_space = [4,4]
40
+ it 'should return only 14 neighbour when in the middle' do
41
+ current_space = [4, 4]
42
42
  rook.generate_neighbours(current_space)
43
43
  expect(rook.neighbours.count).to eq 14
44
- end
45
-
44
+ end
46
45
  end
47
-
48
-
49
46
  end
50
- end
47
+ end
data/spec/spec_helper.rb CHANGED
@@ -1 +1 @@
1
- require_relative "../lib/chess_vwong.rb"
1
+ require_relative '../lib/chess_vwong.rb'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chess_vwong
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vincent Wong
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-26 00:00:00.000000000 Z
11
+ date: 2015-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -60,12 +60,14 @@ executables:
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
+ - ".DS_Store"
63
64
  - ".gitignore"
64
65
  - Gemfile
65
66
  - LICENSE.txt
66
67
  - README.md
67
68
  - Rakefile
68
69
  - bin/chess_vwong
70
+ - chess_vwong-0.0.1.gem
69
71
  - chess_vwong.gemspec
70
72
  - example/example_game.rb
71
73
  - lib/chess_vwong.rb
@@ -94,7 +96,7 @@ files:
94
96
  - spec/queen_spec.rb
95
97
  - spec/rook_spec.rb
96
98
  - spec/spec_helper.rb
97
- homepage: ''
99
+ homepage: https://github.com/wingyu/chess_vwong
98
100
  licenses:
99
101
  - MIT
100
102
  metadata: {}