In my current project, I have to test product that is build using .Net technology ecosystem. First thing that I did was to install IronRuby on my testing Windows box (Amazon aws instance). IronRuby is .Net implementation of Ruby language in .Net platform. As JRuby does with Java world, IronRuby combines two powerful worlds, Ruby and .Net technology ecosystem. That means that I have at my disposal Ruby gems and .Net libraries to help me in my testing activities.
As I have to test features related with dates, I need to do dates (Julian calendar) calculations. Using Ruby Date class (require ‘date’) I can immediately resolve problems with leap years, number of days in month, various date formats.
I hit one problem that Ruby Date class was not up to. That is US week number, which is not aligned with iso 8601 standard. Lets take date ‘20100101’ in format ‘yyyymmdd’ for an example. It is week 52 in US, but in Europe and iso standard is week 53 (you can test it using this link). Ruby implements Date class according to iso 8601 standard.
Then I realized that I have .Net ecosystem at my disposal. Using Google I found my solution. Here is simple gist
And here is appropriate spec
Note that we are using Ruby Date in spec file.
What I learned? By opening to open source technologies, Microsoft is helping worldwide testers to better test products developed using Microsoft technologies. We learned how standards should be used. Problem here is that US does not obey to that standard, but it should.