Sha256: cd75f632b89926b6f225c4461b5495cf1a4dfe038821c50d528bfdf51a0a031c

Contents?: true

Size: 841 Bytes

Versions: 9

Compression:

Stored size: 841 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

9 entries across 9 versions & 1 rubygems

Version Path
grape-entity-1.0.1 spec/grape_entity/exposure/represent_exposure_spec.rb
grape-entity-1.0.0 spec/grape_entity/exposure/represent_exposure_spec.rb
grape-entity-0.10.2 spec/grape_entity/exposure/represent_exposure_spec.rb
grape-entity-0.10.1 spec/grape_entity/exposure/represent_exposure_spec.rb
grape-entity-0.10.0 spec/grape_entity/exposure/represent_exposure_spec.rb
grape-entity-0.9.0 spec/grape_entity/exposure/represent_exposure_spec.rb
grape-entity-0.8.2 spec/grape_entity/exposure/represent_exposure_spec.rb
grape-entity-0.8.1 spec/grape_entity/exposure/represent_exposure_spec.rb
grape-entity-0.8.0 spec/grape_entity/exposure/represent_exposure_spec.rb