This file contains 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 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 |
This file contains 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: Login | |
Scenario: I can login as "jonas" | |
Given I login as "jonas" with username "password" | |
Then I should see the welcome screen |
This file contains 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
if x == 7 | |
puts "That's random" | |
elsif x == 42 | |
puts "That's the answer" | |
else | |
puts "I know nothings about #{x}" | |
end |
This file contains 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 Counter | |
def initialize(start_value = 0) | |
@sum = start_value | |
end | |
def inc(x = 1) | |
@sum = @sum + x | |
end | |
def self.add(a, b) |
This file contains 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
def fn(&block) | |
puts "Before" | |
yield block | |
puts "After" | |
end | |
fn do | |
puts "Hi from block" | |
end |
This file contains 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
if ARGV[0].nil? | |
def argument(_) | |
raise "No arguments provided" | |
end | |
else | |
def argument(index) | |
ARGV[index] | |
end | |
end |
This file contains 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
at_exit do | |
require 'net/http' | |
Net::HTTP.get(URI.parse("http://localhost:34777/kill")) | |
end |
This file contains 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
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" |
This file contains 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: 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" |