toy-robot-simulator 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 45d7af2744c4d7fe285025d8a6777f1e55a81d3ec9bfc71c75a4492405642c4a
4
- data.tar.gz: 427275d04889e285ed1869bcc97e60957ff0e8b57166b087bda91c720e135b64
3
+ metadata.gz: 493b3b5f6204609a9a398ceca538e84cd2529a73a779f73467136cda368cfb2e
4
+ data.tar.gz: 0ecba57f5395830348b866e3d561b40a1d95bdf8815d63e32031a880b9f839af
5
5
  SHA512:
6
- metadata.gz: 437ddd7ff5990ac97f339c46ec4a5d47b30d7f9b4c4d260d224be29298be147829e5603d607a8a9384c5422b52376eb200665e747638ff192461839212264378
7
- data.tar.gz: b1bdd09d3e4b79e0c29a62306acd441fbf74eb4af88849e9b752305d7ab68c931ead274b9f6688802b279645484882971c63bb8c6c20a0be9d3511e2f8392c0a
6
+ metadata.gz: 3f41cc1eac6a2c7ebb95129fd262d46d0259604dddf580707cd0c791fe6264575b11ecc615e68d3282f78f5da0db79bbc022b903e49695d0939142a850789c0b
7
+ data.tar.gz: c2a5b22b759bb12e519f5b4ea073968a94f350f0d0c369aa4991514a7200045a4dff704aee1b91462547c5c74a378aba3f1accac9354e3fd376bdcaf10da2051
data/README.md CHANGED
@@ -1,16 +1,16 @@
1
1
 
2
2
  # Toy Robot Simulator
3
- _version: 0.0.1_
3
+ [![Gem Version](https://badge.fury.io/rb/toy-robot-simulator.svg)](https://badge.fury.io/rb/toy-robot-simulator)
4
4
 
5
5
  The Ruby gem let the toy robot move a table painlessly, easily, and most importantly, **it does not fall from the table**
6
6
 
7
- - [Full gem documentation (version 0.0.3)](https://www.rubydoc.info/gems/toy-robot-simulator/0.0.3/)
7
+ - [Full gem documentation](https://www.rubydoc.info/gems/toy-robot-simulator/0.0.3/)
8
8
  # Installation
9
9
  ```
10
10
  gem install toy-robot-simulator
11
11
  ```
12
12
  ```ruby
13
- gem "toy-robot-simulator", "~> 0.0.3"
13
+ gem "toy-robot-simulator", "~> 0.0.4"
14
14
  ```
15
15
  ```
16
16
  bundle install
@@ -64,9 +64,8 @@ REPORT
64
64
  ```
65
65
 
66
66
  ## Change Log
67
- - Updated documentation
68
- - Added more readable comments in the code
69
- - Updated the CommandSetLoader
67
+ - Based on the coding challenge brief, Robot can be placed on the table again. This issue has been fixed
68
+ - Update the robot spec document
70
69
 
71
70
  ## TODO
72
71
 
@@ -29,7 +29,6 @@ module ToyRobot
29
29
  # @raise [Surface::InvalidFacing] if the facing value is other than [NORTH SOUTH EAST WEST]
30
30
  #
31
31
  def place(x, y, facing)
32
- return if @placed
33
32
  raise Surface::TableIsNotSet if @table.nil?
34
33
  raise Surface::TableOutOfBound unless @table.can_be_placed?(x, y)
35
34
  raise ToyRobot::InvalidFacing unless DIRECTIONS.include?(facing)
@@ -24,14 +24,12 @@ describe ToyRobot::Robot do
24
24
  end
25
25
 
26
26
  context 'robot is already place' do
27
- it 'will ignore any other place commands' do
27
+ it 'will place the robot again to the new coordinates and facing' do
28
28
  robot_with_table.place(0, 0, 'SOUTH')
29
29
  robot_with_table.place(1, 1, 'NORTH')
30
- robot_with_table.place(1, 1, 'WEST')
31
- robot_with_table.place(1, 1, 'EAST')
32
- expect(robot_with_table.x).to eq(0)
33
- expect(robot_with_table.y).to eq(0)
34
- expect(robot_with_table.facing).to eq('SOUTH')
30
+ expect(robot_with_table.x).to eq(1)
31
+ expect(robot_with_table.y).to eq(1)
32
+ expect(robot_with_table.facing).to eq('NORTH')
35
33
  end
36
34
  end
37
35
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toy-robot-simulator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Salman Sohail