Skip to content

Instantly share code, notes, and snippets.

View jarib's full-sized avatar

Jari Bakken jarib

View GitHub Profile
require 'java'
require 'jsch-0.1.38.jar'
class SSH
include_package "com.jcraft.jsch"
def initialize(host, username, password)
@client = JSch.new
@session = @client.getSession(username, host, 22)
@session.setPassword(password)
require "test/unit"
class Foo < Test::Unit::TestCase
0.upto(10) do |n|
define_method("test_#{n}") do
assert_equal(n, @data[n])
end
end
module Celerity
class Browser
class << self
# Added for Watir compatability - not in use by Celerity
attr_accessor :speed, :attach_timeout, :visible
# Added for Watir compatability - not in use by Celerity
alias_method :start_window, :start
# Added for Watir compatability - not in use by Celerity
def reset_attach_timeout; @attach_timeout = 2.0; end
# Added for Watir compatability - not in use by Celerity
package foo;
public interface InterfaceA {
void a();
}
Index: commonwatir/unittests/dl_test.rb
===================================================================
--- commonwatir/unittests/dl_test.rb (revision 0)
+++ commonwatir/unittests/dl_test.rb (revision 0)
@@ -0,0 +1,66 @@
+$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
+require 'unittests/setup'
+
+class TC_Dl < Test::Unit::TestCase
+ include Watir::Exception
Image#fileCreatedDate => file_created_date
Image#fileSize => file_size
Image#hasLoaded? => loaded?
SelectList#getAllContents => options
SelectList#getSelectedItems => selected_options
SelectList#clearSelection => clear_selection
SelectList#includes? => include?
TextField#dragContentsTo => drag_contents_to
The challenge is fairly simple: given a file containing one word per line, print out all the combinations of words that are anagrams; each line in the output contains all the words from the input that are anagrams of each other. For example, your program might include in its output:
kinship pinkish
enlist inlets listen silent
boaster boaters borates
fresher refresh
sinks skins
knits stink
rots sort
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>jquery test</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
(function ($) {
function init(){
$(".editLink").click(function(event){
var scriptTag = "<scri" + "pt> function update() { return 0; } </s" + "cript>";
it "evaluates <script> tags injected in the DOM through JQuery's replaceWith() - fixed in rev. 3598" do
@browser.goto(HTML_DIR + "/jquery.html")
@browser.link(:class, 'editLink').click
@browser.div(:id, 'content').text.should == "typeof update: function"
end
From f0072dc3828f55f9afae38bd1d0ca07ad4f60947 Mon Sep 17 00:00:00 2001
From: jarib <[email protected]>
Date: Sun, 22 Feb 2009 13:28:26 +0100
Subject: [PATCH] Add support for <em> elements (Watir)
---
watir/lib/watir/collections.rb | 6 ++++++
watir/lib/watir/non_control_elements.rb | 3 +++
2 files changed, 9 insertions(+), 0 deletions(-)