Sha256: 4f7bdd6fe5687464ffe4da880a1c2e0051c9df96a4b37b294e9033efa0390595
Contents?: true
Size: 676 Bytes
Versions: 8
Compression:
Stored size: 676 Bytes
Contents
require 'fakeweb' class MockWordpressServer include FilesHelper attr_reader :host def initialize(host: 'wp.example.com') @host = host register_all end protected def register_all FakeWeb.register_uri(:get, "http://#{host}/wp-json/posts", :body => support_file("posts.json"), :content_type => "application/json", :link => support_file("posts.header.txt")) FakeWeb.register_uri(:get, "http://#{host}/wp-json/posts/1", :body => support_file("posts/1.json"), :content_type => "application/json") FakeWeb.register_uri(:get, "http://#{host}/wp-json/posts/2", :body => support_file("posts/2.json"), :content_type => "application/json") end end
Version data entries
8 entries across 8 versions & 1 rubygems