Skip to content

Instantly share code, notes, and snippets.

Feature: Jeg kan skaffe mad
Scenario: Pizza Phone har Hawaii og Pepperoni på menuen
When I visit "http://www.just-eat.dk/"
And I fill in "ctl00_ContentPlaceHolder1_Search_txtPost" with "8381"
And I press "Søg nu"
Then I press "Pizza Phone"
Then I should see "Med tomat, ost, skinke, ananas og oregano"
Then I should see "Med tomat, ost, pepperoni, oksekød og oregano"
@jonasmaturana
jonasmaturana / modified_app_installation_hooks.rb
Created August 2, 2012 19:46
Modified app_installation_hooks.rb
require 'calabash-android/management/app_installation'
AfterConfiguration do |config|
FeatureNameMemory.feature_name = nil
end
Before do |scenario|
feature_name = scenario.feature.name
if FeatureNameMemory.feature_name != feature_name
log "Is first scenario - reinstalling apps"
@jonasmaturana
jonasmaturana / gist:3294638
Created August 8, 2012 12:07
Kill test server at exit
at_exit do
require 'net/http'
Net::HTTP.get(URI.parse("http://localhost:34777/kill"))
end
if ARGV[0].nil?
def argument(_)
raise "No arguments provided"
end
else
def argument(index)
ARGV[index]
end
end
def fn(&block)
puts "Before"
yield block
puts "After"
end
fn do
puts "Hi from block"
end
@jonasmaturana
jonasmaturana / counter.rb
Created September 12, 2012 13:07
Small example of a Ruby class
class Counter
def initialize(start_value = 0)
@sum = start_value
end
def inc(x = 1)
@sum = @sum + x
end
def self.add(a, b)
if x == 7
puts "That's random"
elsif x == 42
puts "That's the answer"
else
puts "I know nothings about #{x}"
end
@jonasmaturana
jonasmaturana / gist:3747626
Created September 19, 2012 04:03
custom_predefined.feature
Feature: Login
Scenario: I can login as "jonas"
Given I login as "jonas" with username "password"
Then I should see the welcome screen
@jonasmaturana
jonasmaturana / gist:5638695
Created May 23, 2013 19:19
Resign for OSX
#!/usr/bin/env bash
tmp_resign_apk_path="/tmp/tmp_path_for_resigned.apk"
echo $tmp_resign_apk_path
rm $tmp_resign_apk_path
zip $1 -d "META-INF/*"
jarsigner -keystore ~/.android/debug.keystore -storepass android -keypass android $1 androiddebugkey
$ANDROID_HOME/tools/zipalign 4 $1 $tmp_resign_apk_path
mv $tmp_resign_apk_path $1