Tag: ruby

Build a TDD RESTful JSON TODO-List API (pt.2)

Fixing the failures   ...by editing our two models: /app/models/todo.rb # app/models/todo.rb class Todo < ApplicationRecord # model association has_many :items, dependent: :destroy # validations validates_presence_of :title, :created_by end app/models/item.rb class Item < ApplicationRecord belongs_to :todo # validation validates_presence_of :name end running bundle exec rspec again will result in 0 errors as expected: Finished in … Continue reading Build a TDD RESTful JSON TODO-List API (pt.2)

Rails Conf 2013: The Magic Tricks of Testing by Sandi Metz

I've watched a great video on Youtube about Testing, by the awesome Sandi Metz. I really like her style when shes holding speeches at Ruby Cons. I think the whole Testing thing is really important for every developer so I give it a try and summarize what she said. Testing Alot of programmers dont bother … Continue reading Rails Conf 2013: The Magic Tricks of Testing by Sandi Metz

Ruby the Hard Way: Designing and Debugging

Rules for If-statements mandatory else-statement if else-statment never runs, because it doesnt make sense, there need to be a die function, that prints out an error message and closes afterwards Don't nest if-statements more than 2 deep Treat if-statements like paragraphs, where each if-elsif-else grouping is like a set of sentences. Put blank lines before and … Continue reading Ruby the Hard Way: Designing and Debugging

Learn ruby the hard way: the hard way!

I set myself a challenge: learn programming every day, except weekends, for at least 5 hours. The reason behind this, was me beeing distracted by timeconsuming stuff like gaming, youtube and social media. I really want to prove to myself, that I can push through it and learn the stuff as soon as possible. Let's … Continue reading Learn ruby the hard way: the hard way!