Skip to content

Instantly share code, notes, and snippets.

@grosscol
Created September 4, 2015 19:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grosscol/89e6cf22f0a99049d2d9 to your computer and use it in GitHub Desktop.
Save grosscol/89e6cf22f0a99049d2d9 to your computer and use it in GitHub Desktop.
Rubocop & Rspec headache with testing a module
# I either end up with a rubocop error or an rspec error. In each case, the travis build will not pass.
# Rubocop error:
# RSpec/DescribedClass: Use described_class instead of Hydra::Works::GenericFile::Characterization
describe Hydra::Works::GenericFile::Characterization do
let(:demo_class) do
Class.new(Hydra::Works::GenericFile::Base) do
include Hydra::Works::GenericFile::Characterization
end
end
end
# RSpec error:
#Failure/Error: include described_class
# NameError:
# undefined local variable or method `described_class' for #<Class:0x007f30ff496718>
describe Hydra::Works::GenericFile::Characterization do
let(:demo_class) do
Class.new(Hydra::Works::GenericFile::Base) do
include described_class
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment