Refactor syndication clients for testability

This commit is contained in:
2023-02-08 21:41:29 +11:00
parent 811affc9b3
commit f704340577
4 changed files with 17 additions and 59 deletions

View File

@@ -1,7 +1,11 @@
require "spec_helper"
require "dry/monads"
RSpec.describe Adamantium::Syndication::Mastodon do
subject { described_class.new }
include Dry::Monads[:result]
let(:client) { double("mastodon client", create_post: Success(), upload_media: Success()) }
subject { described_class.new(mastodon_client: client) }
describe "syndication to mastodon" do
let(:post) {