Skip to content

Instantly share code, notes, and snippets.

View awostenberg's full-sized avatar

Alan Wostenberg awostenberg

View GitHub Profile
@awostenberg
awostenberg / cancel.feature
Created May 17, 2011 17:03
cancel event with end randomization is immediate but should be random
Given a thermostat device joined to a network
When I send the device a drlc event with duration 100 minutes and end time randomization
Then I see event on the device
When I cancel the event with "terminate immediately"
Then I don't see the event on the device
@awostenberg
awostenberg / joiningLights.feature
Created May 17, 2011 18:41
green light should stay solid for 3 seconds after thermostat successfully joins network
Given a thermostat not joined to a network
When I join it to the network
Then I see flashing green light while state is "scanning"
And I see steady green light for 3 seconds while state is "key establishment"
And I see no lights while state is "registered"
@awostenberg
awostenberg / time.feature
Created May 18, 2011 20:58
thermostat local time should update when time preferences are changed
Given a thermostat
When I navigate to "Smart Energy Setup"->"ZigBee Time"
And mark the time
And wait a minute
Then the time should be different
@awostenberg
awostenberg / lockdown.feature
Created May 18, 2011 21:56
Changing lock level from 5 to anything lower should release manual unlock capability
Given a thermostat connected to the ddk
When I set the local level to <lock level>
Then the lock icon is displayed
and the setpoint cannot be changed
and the keypad will/will not unlock device <keypad unlocks it>
Examples:
| lock level |keypad unlocks it |
| 4 | yes |
| 5 | no |
| 4 | yes |
@awostenberg
awostenberg / setpointoob.feature
Created May 19, 2011 18:58
hermostat should ignore setpoint offsets that would put setpoint outside min/max bounds.
Given a tstat at 16.5C
When I send a DRLC event with large setpoint offset of 15C
Then I see "Event Received"
And I see "Event Started"
But the tstat setpoint remains at 16.5C
@awostenberg
awostenberg / price.feature
Created May 19, 2011 20:39
thermostat should ignore pricing events with identical eventIssuerId
Given a thermostat joined to the ddk meter
When I send a 7 cent price event numbered as message N
Then I see the price is 7 cents on the thermostat display
When I send an 8 cent price event as message N
Then I see the price is still 7 cents
When I send an 8 cent price event as message N+1
Then I see the price is 8 cents
@awostenberg
awostenberg / gist:1152852
Created August 17, 2011 22:54
gem install cuke4duke error
> rm -r ~/.m2/repository/.jruby/; rm -r ~/.m2/repository/org/jruby/; mvn -Dcucumber.installGems=true cuke4duke:cucumber
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building maven-cuke 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://build.tendrilinc.com:8081/nexus/content/groups/public/org/jruby/jruby-complete/1.6.1/jruby-complete-1.6.1.pom
Downloaded: http://build.tendrilinc.com:8081/nexus/content/groups/public/org/jruby/jruby-complete/1.6.1/jruby-complete-1.6.1.pom (3 KB at 6.4 KB/sec)
Downloading: http://build.tendrilinc.com:8081/nexus/content/groups/public/org/jruby/jruby-common/1.6.1/jruby-common-1.6.1.pom
Downloaded: http://build.tendrilinc.com:8081/nexus/content/groups/public/org/jruby/jruby-common/1.6.1/jruby-common-1.6.1.pom (5 KB at 138.7 KB/sec)
@awostenberg
awostenberg / jme-tut5-jruby
Created March 23, 2012 02:50
Non-functional translation of the 5th JMonkey Tutorial to JRuby
# This file was translated from Java to JRuby (as well as using some of
# JRuby's dynamicness to get rid of repetition) from the tutorial at
# http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_simpleapplication
require 'java'
# Import some JMonkey classes from a list
%w[
app.SimpleApplication
material.Material
(defn facto [n] (if (= 1 n) 1 (* n (facto (dec n)))))
@awostenberg
awostenberg / gist:2267009
Created March 31, 2012 17:37
Lazy infinite Fibonacci sequence in Clojure
(def fib-seq (lazy-cat [0 1]
(map + fib-seq (rest fib-seq))))