```ruby
require 'test_helper'

describe Prawn::Emoji::Substitution do
  let(:document) { Prawn::Document.new }
  let(:substitution) { Prawn::Emoji::Substitution.new(document) }

  subject { substitution.to_s }

  describe 'full-size-space is used' do
    before do
      document.font_size = 12
      stub(substitution).full_size_space_width { 12 }
    end

    it { subject.must_equal '　' }
  end

  describe 'half-size-space is used' do
    before do
      document.font_size = 12
      stub(substitution).full_size_space_width { 11.99 }
    end

    it { subject.must_equal Prawn::Text::NBSP }
  end
end
```

Test against expected width of substitution string
user
```ruby
require 'test_helper'

describe Prawn::Emoji::Substitution do
  let(:document) { Prawn::Document.new }
  let(:font_size) { 12 }
  let(:substitution) { Prawn::Emoji::Substitution.new(document) }

  before do
    document.font(font) if font
    document.font_size = 12
  end

  subject { substitution.to_s }

  describe 'When Japanese TTF font' do
    let(:font) { Prawn::Emoji.root.join('test', 'fonts', 'ipag.ttf') }

    it { subject.must_equal '　' }
    it { document.width_of(subject).must_equal font_size }
  end

  describe 'When ASCII TTF font' do
    let(:font) { Prawn::Emoji.root.join('test', 'fonts', 'DejaVuSans.ttf') }

    it { subject.must_match /^#{Prawn::Text::NBSP}+$/ }
    it { document.width_of(subject).must_be :>=, font_size - 1 }
    it { document.width_of(subject).must_be :<=, font_size + 1 }
  end

  describe 'When built-in AFM font' do
    let(:font) { nil }

    it { proc { subject }.must_raise Prawn::Errors::IncompatibleStringEncoding }
  end
end
```
assistant