Sha256: d2e1b610e8d163e7fd68b3d8903519f1050b1b74f082ed25151913ebdc99688f

Contents?: true

Size: 1.1 KB

Versions: 6

Compression:

Stored size: 1.1 KB

Contents

require File.dirname(__FILE__) + './models/spec_helper.rb'
require File.expand_path(File.dirname(__FILE__) + "/../../lib/rad/sim/arduino_sketch.rb")
require File.expand_path(File.dirname(__FILE__) + "/../examples/hello_world.rb" )

context "ArduinoSketch running HelloWorld example" do
  it "should successfully make an instance" do
    lambda{HelloWorld.new}.should_not raise_error
  end
end

context "HelloWorld#led" do
  it "should return a correctly configured Pin" do
    p = HelloWorld.new.led
    p.type.should == :output
    p.num.should == 7
    p.value.should == false
  end
end

context "HelloWorld#digitalWrite" do
  setup do
    @h = HelloWorld.new
  end 

  it "should set the value of the pin to true if told to" do
    @h.digitalWrite(@h.led, ON)
    @h.led.value.should == true
  end

  it "should set the value of the pin to false if told to" do
    @h.digitalWrite(@h.led, OFF)
    @h.led.value.should == false
  end
end

context "HelloWorld#delay" do
  it "should maybe keep track of the time in some way?"
end

context "HelloWorld#loop" do
  it "should execute the loop in the context of the instance"
end

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
neo_rad-0.4.0 spec/sim/hello_world_spec.rb
atduskgreg-rad-0.2.5 spec/sim/hello_world_spec.rb
atduskgreg-rad-0.3.0.1 spec/sim/hello_world_spec.rb
atduskgreg-rad-0.3.1 spec/sim/hello_world_spec.rb
rad-0.2.9 spec/sim/hello_world_spec.rb
rad-0.3.0 spec/sim/hello_world_spec.rb