Thursday, December 24, 2009

Scanning for badblocks in a a harddisk

Just bought a new harddisk, did scanning of badblocks with:

sudo badblocks -svwf /dev/sdc1

Amazingly, for 320GB, it takes 30:33:41.35 hrs to complete.

Thursday, December 10, 2009

Adding Webrat Matchers to Culerity

If u are using culerity, and somehow u missed the webrat matchers, eg. has_xpath(), here's what u can do:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require 'webrat/core/xml'
require 'webrat/core/matchers'

module WebratLike

include Webrat::Matchers

def response
html = $browser.html
def html.body ; to_s ; end
html
end

end

World(WebratLike)
end
end

Enjoys !!

Wednesday, December 9, 2009

Testing of Clicking of Checkbox

We have checkboxes registered for onchange event handler. In testing using blueridge, to simulate checking of a checkbox, the following more ideal approaches, sadly, don't work:
1
2
$("input:checkbox:first").change(); #1
$("input:checkbox:first").click().change(); #2

But the following works:
1
$("input:checkbox:first").attr('checked', true).change();

Bitten once.

Labels