File: test_context.rb

package info (click to toggle)
ruby-nfc 3.1.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 160 kB
  • sloc: ansic: 304; ruby: 129; makefile: 5
file content (22 lines) | stat: -rw-r--r-- 410 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require "minitest/autorun"
require "nfc"

module NFC
  class TestContext < Minitest::Test
    def test_init
      assert NFC::Context.new
    end

    def test_list_devices
      ctx = NFC::Context.new
      assert ctx.devices(1)
    end

    def test_open
      ctx = NFC::Context.new
      devs = ctx.devices(1)
      skip "no devs attached" unless devs.length > 0
      dev = ctx.open nil
    end
  end
end