Tag Archives: Example Code

Counting strings in a file: Ruby vs Windows Command shell

This is not the usual material that I put up, but I’d like to immortalize an event that demonstrated yet again the beauty of Ruby for basic file manipulation, especially in contrast to doing the same in a Windows command … Continue reading

Posted in Making Life Easier, Mistakes, Ruby, Tools | Tagged , , , | 2 Comments

Announcing ‘bewildr’ – test your WPF UI apps with IronRuby

Get it here: http://www.bewildr.info After writing an automation framework to test a WPF GUI using IronRuby and White, I decided to write a ruby-specific gem for automating WPF UI tests. Kinda like Watir, but for WPF instead of the web. The … Continue reading

Posted in Automated Testing, Example Code, IronRuby, Tools, bewildr | Tagged , , , , , | 3 Comments

How to get the submodules of a ruby module

I needed to be able to find out what modules were defined inside a particular ruby module. Kinda like wanting to find out what child namespaces exist for a module. It’s probably more easily explained with an example. Given the … Continue reading

Posted in Example Code, Ruby | Tagged , | Leave a comment

Programmatically take screenshot in IronRuby

After figuring out how to take a screenshot using .Net, I translated the C# I came up with to IronRuby. Now, when any of my IronRuby-powered tests fail, I take a screenshot – saves loads of time when trying to … Continue reading

Posted in Example Code, IronRuby, Test Management | Tagged , , , , | 2 Comments

How to connect to an Oracle database in IronRuby

After spending a few hours trying to connect to an oracle database in ironruby using various gems, I gave up. None of the gems out there would work, each for a different reason. It was time to write my own … Continue reading

Posted in Example Code, IronRuby, Making Life Easier, Ruby, Test Data, Tools | Tagged , , , , | 2 Comments

Testing redirects with ruby

Testing redirects from a web app is simple enough – make a request and check the response code making sure it’s a 301, 302 or whatever you’re expecting. The test you end up writing isn’t nice idiomatic ruby though. So, … Continue reading

Posted in Automated Testing, Example Code, Making Life Easier, RSpec, Ruby, Tools | Tagged , , , , , | Leave a comment

How to test a WPF app using IronRuby and White

—UPDATE— Since I wrote this post, I have put together a ruby gem designed for testing WPF UIs called ‘bewildr’. I wrote up an introductory post about bewildr here. Bewildr removes the need for using White – it’s written in … Continue reading

Posted in Automated Testing, Example Code, IronRuby, Making Life Easier, Ruby, Test::Unit, Tools, bewildr, white | Tagged , , , , , , , , | 1 Comment