Sha256: 324c9df02d041e9861d60d0432bdd4a654656c4153fb7605e2e3847c4783633b
Contents?: true
Size: 714 Bytes
Versions: 14
Compression:
Stored size: 714 Bytes
Contents
require 'spec_helper' describe DispatchRider::NotificationServices::FileSystem::Channel do let(:path) { File.expand_path("tmp/test/channel") } let(:published_message) { File.new(Dir["#{path}/*.ready"].first).read } before { FileUtils.mkdir_p(path) } after { FileUtils.rm_rf(path) } subject { described_class.new(path) } describe "#publish" do let(:message) { { subject: "foo", body: "bar" }.to_json } it "adds a file to the path folder" do expect { subject.publish(message) }.to change { Dir["#{path}/*"].length }.by(1) end it "writes the message to the file" do subject.publish(message) expect(published_message).to eq(message) end end end
Version data entries
14 entries across 14 versions & 1 rubygems