File tree Expand file tree Collapse file tree 2 files changed +58
-0
lines changed
lib/ldclient-rb/impl/datasource Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 11require 'concurrent'
2+ require 'ldclient-rb/interfaces'
23
34module LaunchDarkly
45 module Impl
Original file line number Diff line number Diff line change 1+ require "spec_helper"
2+ require "ldclient-rb/impl/datasource/null_processor"
3+
4+ module LaunchDarkly
5+ module Impl
6+ module DataSource
7+ describe NullUpdateProcessor do
8+ subject { NullUpdateProcessor . new }
9+
10+ describe "#initialize" do
11+ it "creates a ready event" do
12+ expect ( subject . instance_variable_get ( :@ready ) ) . to be_a ( Concurrent ::Event )
13+ end
14+ end
15+
16+ describe "#start" do
17+ it "returns a ready event that is already set" do
18+ ready_event = subject . start
19+ expect ( ready_event ) . to be_a ( Concurrent ::Event )
20+ expect ( ready_event . set? ) . to be true
21+ end
22+
23+ it "returns the same event on multiple calls" do
24+ first_event = subject . start
25+ second_event = subject . start
26+
27+ expect ( second_event ) . to be ( first_event )
28+ end
29+ end
30+
31+ describe "#stop" do
32+ it "does nothing and does not raise an error" do
33+ expect { subject . stop } . not_to raise_error
34+ end
35+ end
36+
37+ describe "#initialized?" do
38+ it "always returns true" do
39+ expect ( subject . initialized? ) . to be true
40+ end
41+
42+ it "returns true even before start is called" do
43+ processor = NullUpdateProcessor . new
44+ expect ( processor . initialized? ) . to be true
45+ end
46+ end
47+
48+ describe "DataSource interface" do
49+ it "includes the DataSource module" do
50+ expect ( subject . class . ancestors ) . to include ( LaunchDarkly ::Interfaces ::DataSource )
51+ end
52+ end
53+ end
54+ end
55+ end
56+ end
57+
You can’t perform that action at this time.
0 commit comments