Alle Artikel in: Code

The Kindergarten-state-of-mind

Tom keeps focused.

„Don’t worry about feeling stupid.“ They keep telling you this at Makers Academy. „You will get used to not knowing how things work,“ is another piece of advice I have heard several times. But I do worry that I’m too stupid to get my head around this. I thought I knew how to make my objects talk to each other. I thought I had understood that a proc wraps a method to have it executed […]

RSpec: How to stub a random variable (make the weather as you need it to be)


In our last challenge there was an airport that gave or declined landing permission for planes based on the weather. There was no real weather forecast, I just generated a random weather: def generate_weather [:sunny, :sunny, :sunny, :stormy].shuffle.first end The Ruby-method .shuffle randomly mixes the values within the array and .first than takes the first value out. RSpec test: force the function return a specific value I implemented an if-statement in my landing- and take-off-procedures. So […]

TDD – My first major obstacle


For someone like me, new to development, it sounds really strange to write a test before having a function or product ready. But anybody at Makers Academy is a 100% convinced that the so called technique of “Test Driven Development” (TDD) is absolutely essential for writing good, maintainable code. What it is and how it works (non-technically spoken) In TDD developers at first break their problem down into objects and actions. In our first week’s […]