File: base_spec.rb

package info (click to toggle)
ruby-concurrent 1.3.6-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,152 kB
  • sloc: ruby: 30,953; java: 6,128; ansic: 293; makefile: 26; sh: 19
file content (75 lines) | stat: -rw-r--r-- 1,306 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
require_relative 'buffered_shared'
require 'concurrent/channel/buffer/base'

module Concurrent::Channel::Buffer

  RSpec.describe Base, edge: true do

    subject { described_class.new }

    specify do
      expect(subject.capacity).to eq 0
    end

    specify do
      expect(subject).to be_blocking
    end

    specify do
      expect {
        subject.size
      }.to raise_error(NotImplementedError)
    end

    specify do
      expect {
        subject.empty?
      }.to raise_error(NotImplementedError)
    end

    specify do
      expect {
        subject.full?
      }.to raise_error(NotImplementedError)
    end

    specify do
      expect {
        subject.put(42)
      }.to raise_error(NotImplementedError)
    end

    specify do
      expect {
        subject.offer(42)
      }.to raise_error(NotImplementedError)
    end

    specify do
      expect {
        subject.take
      }.to raise_error(NotImplementedError)
    end

    specify do
      expect {
        subject.poll
      }.to raise_error(NotImplementedError)
    end

    specify do
      expect {
        subject.next
      }.to raise_error(NotImplementedError)
    end

    specify do
      expect(subject).to_not be_closed
    end

    specify do
      subject.close
      expect(subject).to be_closed
    end
  end
end