Testing the Notifier class with Rspec
Today, I needed to spec the Notifier (mailer) class in a Rails project. I don’t mean to spec the view, I just needed to test if the Notifier class method was being called with some params. For example, I had this user story As a User When I am an owner of an issue And the issue status changes I want to get an email So, all I had to to in my spec, is to test if the Notifier class was being called, I am testing the view in the notifier_spec, so no need to test it twice.
Run your specs in logical groups
I stumbled upon this StackOverflow question: testing – Organizing rspec 2 tests into ‘unit’ and ‘integration’ categories in rails – Stack Overflow. Basically, the guy asks how he can run specs isolated into logical groups, running the unit without running the integration and so on. At Gogobot, we have exactly that, since we run our specs in the CI, we can decide which to run, and they run one after the other and dependent on each other, so if you fail UNIT, the build fails, no need to continue on.
With GOV.UK, British government redefines the online government platform – O’Reilly Radar
Reading this article made me realize there’s hope in making government sites better. The state of the government sites in Israel for example is shameful, all written in .Net, no standards and no cross-platform consideration. It’s a very good read. Why create an open source stack? “Why not?” asked Bracken. “It’s a government platform, and as such it belongs to us all and we want people to contribute and share in its development.
Submit any form with a keyboard shortcut
Say you have a simple form like “Add comment” similar to this imageAdd comment form Now, this is a text-area, so the ENTER key will break rows and will not automatically submit the form to the server. I want to create a flexible way to send the form to the server with a keyboard shortcut like CTRL+ENTER. Thanks to an awesome library by Thomas Fuchs called KeyMaster it turned out to be quite simple.
Yehuda Katz : Tradeoffs and Choices, Why Ruby isn’t Python | RuPy :: Strongly Dynamic Conference on Blip
This video is a bit on the longer side definitely, but if you are a Ruby developer (not a beginner), you will find this talk very interesting.
Remote Pair Programming – Remote pair programming resources, articles, and thoughts.
I have been a remote programmer for a while now (over 3 years), working across time-zones (10 hours difference in many cases). I used this blog a lot as an inspiration and took many great tips. If you are into remote programming and you have remote workers, you should read the posts in this blog. Remote Pair Programming – Remote pair programming resources, articles, and thoughts..
14 Ways to Contribute to Open Source without Being a Programming Genius or a Rock Star
Contribution to open source has a myth around it. People think that “contributing” means changing huge chunks of the code, and being a genius. It’s actually not the case, documentation for example is a huge contribution to open source, sometimes scratching your own itch with changing a single method is also contribution. Find something you like and work with every day, and when you encounter a bug, or a need for something, try and implement it.
Pull Request #5340: Added wrapper tag for simple format, added test by KensoDev · rails/rails
Following my latest post about the simple_format, I think that it’s broken to assume only “p” tags are valid wrappers. So, I opened a pull request to Rails itself. Basically, it changes simple_format so you can pass in the wrapper tag you want, I found myself wanting a “div” or a “span” too many times. Pull Request #5340: Added wrapper tag for simple format, added test by KensoDev · rails/rails.
Essential Sublime Text 2 Plugins and Extensions | Nettuts+
I switched from TextMate to Sublime Text 2. Been using it for months now and it keeps surprising me with how fast, smooth of an experience it is. If you are still using TextMate or something else, you need to look at this post. Essential Sublime Text 2 Plugins and Extensions | Nettuts+.
Do your own Agile…
There’s a lot of buzz going on about software development methodologies, people talking about Agile, Kanban, Pair, XP and more and more. There’s not much people are talking about when it comes to a single developer. I have been a consultant/developer for the past ~3 years or so, working from home for several clients both in Israel and abroad (US mainly). During this time I gained tons of experience in knowing what works and what doesn’t, this may be specific to me, but I don’t think so, so I decided to share this knowledge.