require 'great_pretender/pretender'
require 'ostruct'

class PrefixSlugPretender
  def say_hello
    "Hello, guest!"
  end
end

class TestSlugPretender
  def ohai
    "ohai"
  end
end

describe GreatPretender::Pretender do

  let(:mockup) { OpenStruct.new(slug: "prefix_slug/test_slug") }
  let(:pretender) { GreatPretender::Pretender.new(mockup) }
  let(:recipient) do
    mod = pretender.to_module
    Class.new { include mod }.new
  end

  it "delegates methods to pretenders named after mockups" do
    expect(recipient.ohai).to eq("ohai")
  end

  it "delegates methods to pretenders in the slug chain" do
    expect(recipient.say_hello).to eq("Hello, guest!")
  end

end

require 'great_pretender/pretender'
require 'ostruct'

class PrefixSlugPretender
  def say_hello
    "Hello, guest!"
  end

  def name
    "Flip"
  end
end

class TestSlugPretender
  def ohai
    "ohai"
  end

  def name
    "Avery"
  end
end

describe GreatPretender::Pretender do

  let(:mockup) { OpenStruct.new(slug: "prefix_slug/test_slug") }
  let(:pretender) { GreatPretender::Pretender.new(mockup) }
  let(:recipient) do
    mod = pretender.to_module
    Class.new { include mod }.new
  end

  it "delegates methods to pretenders named after mockups" do
    expect(recipient.ohai).to eq("ohai")
  end

  it "delegates methods to pretenders in the slug chain" do
    expect(recipient.say_hello).to eq("Hello, guest!")
  end

  it "delegates methods to the most specific responder" do
    expect(recipient.name).to eq("Avery")
  end
end

Add test for method specificity in pretenders
Add test for method specificity in pretenders
