More TDD, RSpec, and Boris, and Gaming Netflix
This morning I actually followed the plan I was meant to yesterday (oops) by working solo on Practicals this morning. I started off by re-working my TDD flow chart after receiving some coach feedback.

I also began work on another Practical replicating RSpec tests. I should probably begin by explaining what RSpec is, I have mentioned it before, but completely forget to talk about what it is or what it does.
RSpec is a gem you can install for Ruby, and it allows you to write and run tests on your code in Ruby. It comes with lots of pre-built test ‘Matchers’ such as include, equals, raise_error, which allow you to compare your code against certain specifications. RSpec is really useful in that it is built to be quite intuitive, in that you write tests basically how you would say them. You generally start with a to statement; ‘to “check array includes number” do’. Pretty clear what that is testing for. The next part is the set up, so you would in this case push a number into the array; ‘array = [], array << 1’. Finally you put your test criteria; ‘expect(array).to include 1’. Clearly you are expecting your array to include the number 1. In the background include would iterate through the array to check this. Altogether it would look like this:
to “check array includes number” do
array = []
array << 1
expect(array).to include 1
Getting back to the practical, I had to write my own ‘Matchers’. The walkthrough got us to write an expect and equals matcher, with useful tips. It took some tweaking but I was able to write both these fairly quickly. After that there was 3 extension matchers to attempt, without any help. The first one was ‘include’. At first I kept getting errors and couldn’t figure out why, the exact same code had worked for other classes but not Include, which had me stumped. After a little Google magic, I found out that there is certain things you can’t name your methods, as there are background methods which use those names. Turns out include is one of them, so I changed the name to includes. It worked first time! I have also altered it to account for if the argument put in is a hash or array. I also implemented the respond_to and be_a matchers which both now work. The last part wants us to implement to blocks, which I am not sure how to do, so will attempt tomorrow.
In the afternoon we got into pairs and carried on the work on our Boris Bikes programme. The person I was paired with was slightly behind again, so we started from the further back point. It was good for me to go over it again, to really test what I had been learning. I am happy that I remembered most of the work, it must be sinking in! There was some bits that he had done differently, and I was able to figure out how to make it work their way as well which is nice, that says to me I am understanding the theory and not just memorising how I did it. By the end of the day we had got back to the point I reached yesterday, I think most people are at that point now, so tomorrow we should be able to carry on from there no matter who I am with, and hopefully finish the project off in the afternoon.
Yesterday Google announced Stadia, a Netflix-like live streaming service for games. It works by having huge servers somewhere doing all of the GPU and CPU heavy lifting by actually running the game, and then streaming the video output to your device. Because of this, the device you are using to play on does not need to be particularly powerful, you just need a decent internet connection. To me this sounds like a real game changer (pun intended). The fact that now anyone can play these games anywhere, and not be limited by the hardware they own is amazing. This Digital Foundry video has a lot more detail and is worth a watch. I am very excited about the prospect of gaming anywhere and everywhere, now I just need to convince an ISP to install fibre optic broadband to my house, I am not sure 8mbps is going to be enough to stream a 4k 60fps game…

(at the end of the day of course)
