Function | Function type | Target passed as | Returns |
---|---|---|---|
also |
Extension | it |
Target |
apply |
Extension | this |
Target |
let |
Extension | it |
Block return value |
run |
Extension | this |
Block return value |
with |
Regular | this |
Block return value |
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
module AuthHelper | |
def http_login | |
user = 'username' | |
pw = 'password' | |
request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(user,pw) | |
end | |
end | |
module AuthRequestHelper | |
# |
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
import org.junit.rules.TestRule; | |
import org.junit.runner.Description; | |
import org.junit.runners.model.Statement; | |
/** Got flaky tests? Shampoo them away. */ | |
public final class ShampooRule implements TestRule { | |
private final int iterations; | |
public ShampooRule(int iterations) { | |
if (iterations < 1) throw new IllegalArgumentException("iterations < 1: " + iterations); |
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
public class ScreengrabHelper { | |
private static ScreengrabHelper instance; | |
private static final long INIT_DELAY = 2000; | |
private long delay; | |
private boolean screenShotTaken; | |
public ScreengrabHelper() { | |
this.delay = INIT_DELAY; |