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 ExpensiveOperation | |
def self.lookup(question) | |
"This goes to the database" | |
end | |
end | |
class UsesExpensiveOperation | |
def initialize | |
@cache = {} | |
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
When I select the following previous correspondence items: | |
| type | date | filename | | |
| CTA | 01Jan09 | EMAIL | | |
When /^I select the following previous correspondence items:$/ do |table| | |
checkboxes = PreviousCorrespondenceSteps.get_checkboxes_for(table) | |
checkboxes.each {|b| b.set(true) } |
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
config.after_initialize do | |
MVOR::Gateway.use_3ds_test_gateway | |
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
config.after_initialize do | |
AppConfig.payment_gateway_mode = :test | |
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
Daemon 0 | |
LogFacility - | |
LogLevel 5 | |
ListenHTTP | |
Address lenny.ridge | |
Port 3001 | |
Service | |
URL "/MyApp1/.*" |
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 self.class.const_defined?('APP_ROOT') | |
APP_ROOT = File.expand_path(File.dirname(__FILE__) + '/../../../../../') | |
end | |
puts "#{File.basename(__FILE__)}: APP_ROOT: #{APP_ROOT}" | |
require File.expand_path("#{File.dirname(__FILE__)}/no_rails_env_spec_helper") | |
unless self.class.const_defined?('Rails') | |
require 'benchmark' |
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
1 require File.dirname(__FILE__) + "/spec_helper" | |
2 | |
3 require 'email' | |
4 | |
5 describe Email do | |
6 describe '.normalize', ' should strip email down to core address' do | |
7 def self.normalized(original, options) | |
8 it %{normalizes '#{original}' as '#{options[:should_be]}'} do | |
9 Email.normalize(original).should == options[:should_be] | |
10 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
#!/usr/bin/env jruby | |
raise "Must specify CATALINA_HOME" unless ENV['CATALINA_HOME'] | |
ENV['GEM_HOME'] ||= File.expand_path('../../gems', __FILE__) | |
require File.expand_path('../../../META-INF/init', __FILE__) | |
# expected by rails/commands | |
APP_PATH = File.expand_path('../../config/application', __FILE__) |
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
# More rubyish/convenient interface to Java Properties(e.g. Loading connection config from properties file) | |
class JavaProperties | |
def initialize(name) | |
input_stream = | |
Java::Java.lang.Thread.currentThread.contextClassLoader.getResourceAsStream(name) | |
if input_stream | |
@properties = Java::java.util.Properties.new | |
@properties.load(input_stream) | |
input_stream.close |
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
public interface TxCallback { | |
public Object execute(TransactionHolder txHolder) throws Exception; | |
} |
OlderNewer