Skip to content

Instantly share code, notes, and snippets.

Avatar

Levi Wilson leviwilson

  • Northwoods
  • Berthoud, CO
View GitHub Profile
@leviwilson
leviwilson / Gemfile
Last active Aug 29, 2015
mohawk / uia gem setup
View Gemfile
source 'http://rubygems.org'
# ...
gem 'mohawk', git: 'git://github.com/leviwilson/mohawk.git', branch: 'uia_gem'
gem 'uia', git: 'git://github.com/northwoodspd/uia.git'
# ...
View your_screen.rb
class YourScreen
include Mohawk
def press_enter
w = Uia.find_element handle: adapter.window.handle # get the top-level window for this screen
t = w.find id: 'yourTextFieldId'
t.send_keys :enter
end
end
@leviwilson
leviwilson / .gitattributes
Created Feb 19, 2014
Default .gitattributes that the Git for Visual Studio plugin gives you.
View .gitattributes
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
View keybase.md

Keybase proof

I hereby claim:

  • I am leviwilson on github.
  • I am leviwilson (https://keybase.io/leviwilson) on keybase.
  • I have a public key whose fingerprint is 3392 4A26 7AC8 21D5 9E80 802D 12C5 EA5D 4297 5CD8

To claim this, I am signing this object:

View object.rb
class Object
def kill_puppies(how_many)
sleep how_many
end
end
@leviwilson
leviwilson / README.md
Last active Aug 29, 2015
Kiwi Helper Class Question
View README.md

Background

Warning: I do not know objective-c that well

I'm working in some specs. Sometimes I see an opportunity to use some test helpers to eliminate some duplication in my testing. I'd like to be able to create a helper class that is able to wrap some of these helper verification methods and re-use it to clean up some of my specs.

Problem

I don't have access to any of the should flavor of Kiwi verifications within my tester. I'm assuming because I'm not within the SPEC_BEGIN / SPEC_END (as those macros call other Kiwi methods).

The Question

View controller.js
myapp.controller('myController', ['myService', function (myService) {
$scope.autofillSearch; //Input field in HTML
$scope.findAutofill = function () {
myService.autofill($scope.autofillSearch)
.success(function (data) {
window.console.log('Yay! ' + data);
})
.error(function () {
window.console.log('BOOO!');
});
View meaning_cloud.rb
require 'faraday'
require 'dotenv'
require 'json'
module MeaningCloud
def self.topics(options)
request :topics, options, lang: 'en', tt: 'ecr'
end
def self.sentiment(options)
@leviwilson
leviwilson / CppUTest_MockTest.cpp
Created Feb 17, 2011
CppUTest - expectNCalls fails with ignoreOtherParameters
View CppUTest_MockTest.cpp
#include <iostream>
#include <CppUTest/CommandLineTestRunner.h>
#include <CppUTestExt/MockSupport.h>
using namespace std;
class Foo
{
public:
virtual void MyFunction(int something)
View gist:844664
#ifndef MemLeakCheckingTest_h
#define MemLeakCheckingTest_h
#include <gtest/gtest.h>
#if defined(WIN32) && defined(_DEBUG)
// Used to redirect _CrtXXX functions output to stderr, instead of the MSVC
// trace window.
int __cdecl crtReportHook(int reportType, char *szMsg, int *retVal)