Sha256: e8acb020eb4d61a51ef82f198ffe801ba02fa18d64bb19d3732e1928b36d1dc1

Contents?: true

Size: 844 Bytes

Versions: 2

Compression:

Stored size: 844 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Grape::Entity::Exposure::RepresentExposure do
  subject(:exposure) { described_class.new(:foo, {}, {}, double, double) }

  describe '#setup' do
    subject { exposure.setup(using_class_name, subexposure) }

    let(:using_class_name) { double(:using_class_name) }
    let(:subexposure)      { double(:subexposure) }

    it 'sets using_class_name' do
      expect { subject }.to change { exposure.using_class_name }.to(using_class_name)
    end

    it 'sets subexposure' do
      expect { subject }.to change { exposure.subexposure }.to(subexposure)
    end

    context 'when using_class is set' do
      before do
        exposure.using_class
      end

      it 'resets using_class' do
        expect { subject }.to change { exposure.using_class }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
grape-entity-0.7.1 spec/grape_entity/exposure/represent_exposure_spec.rb
grape-entity-0.7.0 spec/grape_entity/exposure/represent_exposure_spec.rb