This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
# Matches an annual leave step like the following in a cucumber feature file: | |
# " | |
# Then I should see annual leave "2009-02-20 (afternoon)" with "Status" as "Approved" | |
# " | |
# | |
Then /^I should see annual leave "([^"]+)" with "([^"]+)" as "([^"]+)"$/ do | date_time, label, value | | |
Then 'I should see annual_leave "%s" with "%s" as "%s" showing "%s" as "%s"' % | |
[ 'Date/Time', date_time, label, value ] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Create Public Holidays | |
In order for the system to function as a reasonable HRM | |
It should support public holidays w.r.t countries | |
As human resource personnel, I should be able to create public holidays in the system | |
Scenario Outline: Access "New Public Holiday" Page | |
Given the following countries exist in the system (...) | |
| name | | |
| Singapore | | |
| Malaysia | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
** Invoke features:tag:doing (first_time) | |
** Invoke db:acceptance:prepare (first_time) | |
** Invoke db:abort_if_pending_migrations (first_time) | |
** Invoke environment (first_time) | |
** Execute environment | |
** Execute db:abort_if_pending_migrations | |
** Execute db:acceptance:prepare | |
** Invoke db:acceptance:load (first_time) | |
** Invoke db:acceptance:purge (first_time) | |
** Invoke environment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
`cat ~/.bash_aliases | egrep '^alias' | sed 's/alias//'`.split("\n").each do |line| | |
parts = line.strip.split(/=/) | |
name, cmd = parts[0], parts[1].gsub(/('|")/,'') | |
file = '/home/%s/.config/fish/functions/%s.fish' % [`whoami`.strip, name] | |
content = [ 'function %s' % name, ' %s $argv;' % cmd, 'end' ].join("\n") | |
File.open(file, 'w+'){|io| io.write(content) } | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActionMailer::Base.class_eval do | |
DELIVERIES_CACHE_PATH =⋅ | |
File.join(RAILS_ROOT,'tmp','cache','action_mailer_acceptance_deliveries.cache') | |
def perform_delivery_acceptance(mail) | |
deliveries << mail | |
File.open(DELIVERIES_CACHE_PATH,'w') do |f| | |
Marshal.dump(deliveries, f) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Steam | |
module Matchers | |
module HtmlUnit | |
class HasContent #:nodoc: | |
# nothing interesting, the original content remains | |
end | |
### | |
# Directly extracted from Webrat::Matchers::HaveXpath with minor edits to avoid | |
# calling webrat stuff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:gdb_debug=>true} | |
=> Hijacking...> (no debugging symbols found) | |
> Attaching to program: /usr/bin/ruby1.8, process 9433 | |
> Reading symbols from /usr/lib/libruby1.8.so.1.8...(no debugging symbols found)...done. | |
> Loaded symbols for /usr/lib/libruby1.8.so.1.8 | |
> Reading symbols from /lib/libpthread.so.0...(no debugging symbols found)...done. | |
> [Thread debugging using libthread_db enabled] | |
> [New Thread 0x7fea191b16f0 (LWP 9433)] | |
> [New Thread 0x7fea14f2f950 (LWP 9852)] | |
> Loaded symbols for /lib/libpthread.so.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LocalTime | |
@@zone = Time.zone | |
class << self | |
def method_missing(method, *args) | |
args.empty? ? @@zone.send(method) : @@zone.send(method, *args) | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script shows how a single xpath can be used for matching a specific row in an html | |
# table, taking into account the the header text <th/> and cell text <td/>. It is able to | |
# handle case-sensitivity & nested inner text. | |
# | |
# Pls note that in order to test out case-sensitivity, u need to tweak IS_CASE_SENSITIVE & | |
# the html string. | |
# | |
# BTW, let me know how the generated xpath can be more elegant than it currently is. | |
# | |
require 'rubygems' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unless ENV['RAILS_ENV'] == 'production' | |
module Resque | |
class << self | |
alias_method :orig_enqueue, :enqueue | |
def Resque.enqueue(*args) ; end | |
end | |
end | |
end |