Sha256: 71b41d958533560b205c2bf0a9e001fcdfa60108b2c13a922ae351a3d53e73f0

Contents?: true

Size: 1.1 KB

Versions: 7

Compression:

Stored size: 1.1 KB

Contents

# figure out where we are being loaded from
if $LOADED_FEATURES.grep(/spec\/spec_helper\.rb/).any?
  begin
    raise "foo"
  rescue => e
    puts <<-MSG
  ===================================================
  It looks like spec_helper.rb has been loaded
  multiple times. Normalize the require to:

    require "spec/spec_helper"

  Things like File.join and File.expand_path will
  cause it to be loaded multiple times.

  Loaded this time from:

    #{e.backtrace.join("\n    ")}
  ===================================================
    MSG
  end
end

$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'spec'
require 'spec/autorun'
require 'fakeweb'
require 'rfid-usb-gom-sensor'

Spec::Runner.configure do |config|
  config.before :each do
    FakeWeb.register_uri(
      :get, "http://gom:345/gom/config/connection.txt", 
      :body => "client_ip: 10.0.0.23"
    )
    $c = (Gom::Remote::Connection.new "http://gom:345/sensor/rfid/usb-reader")

    $sp = Object.new
    SerialPort.stub!(:new).and_return($sp)
  end

  config.after :each do
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rfid-usb-gom-sensor-0.1.6 spec/spec_helper.rb
rfid-usb-gom-sensor-0.1.5 spec/spec_helper.rb
rfid-usb-gom-sensor-0.1.4 spec/spec_helper.rb
rfid-usb-gom-sensor-0.1.3 spec/spec_helper.rb
rfid-usb-gom-sensor-0.1.2 spec/spec_helper.rb
rfid-usb-gom-sensor-0.1.1 spec/spec_helper.rb
rfid-usb-gom-sensor-0.1.0 spec/spec_helper.rb