Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSpec/InstanceVariable should ignore dynamic classes #506

Closed
deivid-rodriguez opened this issue Nov 22, 2017 · 0 comments · Fixed by #523
Closed

RSpec/InstanceVariable should ignore dynamic classes #506

deivid-rodriguez opened this issue Nov 22, 2017 · 0 comments · Fixed by #523
Labels

Comments

@deivid-rodriguez
Copy link
Contributor

deivid-rodriguez commented Nov 22, 2017

We have some specs we we define dynamic classes inside specs like this

describe Decidim::Exporters::CSV do
  let(:serializer) do
    Class.new do
      def initialize(resource)
        @resource = resource
      end

      def serialize
        {
          id: @resource.id,
          serialized_name: @resource.name,
          other_ids: @resource.ids
        }
      end
    end
  end

  # my specs ...
end

RSpec/InstanceVariable should not fire in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants