A library for handling DID identifiers used in Bluesky AT Protocol
at master 54 lines 1.2 kB view raw
1# frozen_string_literal: true 2 3require 'simplecov' 4 5SimpleCov.start do 6 enable_coverage :branch 7 add_filter "/spec/" 8end 9 10require 'didkit' 11require 'json' 12require 'webmock/rspec' 13 14RSpec.configure do |config| 15 # Enable flags like --only-failures and --next-failure 16 config.example_status_persistence_file_path = ".rspec_status" 17 18 config.expect_with :rspec do |c| 19 c.syntax = [:should, :expect] 20 end 21 22 config.mock_with :mocha 23end 24 25module SimpleCov 26 module Formatter 27 class HTMLFormatter 28 def format(result) 29 # silence the stdout summary, just save the html files 30 unless @inline_assets 31 Dir[File.join(@public_assets_dir, "*")].each do |path| 32 FileUtils.cp_r(path, asset_output_path, remove_destination: true) 33 end 34 end 35 36 File.open(File.join(output_path, "index.html"), "wb") do |file| 37 file.puts template("layout").result(binding) 38 end 39 end 40 end 41 end 42end 43 44BSKY_APP_DID = 'did:plc:z72i7hdynmk6r22z27h6tvur' 45 46WebMock.enable! 47 48def load_did_file(name) 49 File.read(File.join(__dir__, 'dids', name)) 50end 51 52def load_did_json(name) 53 JSON.parse(load_did_file(name)) 54end