Pattern: Constant assignment in pec
Issue: -
Checks for constant assignment inside of specs.
# bad
describe Something do
PAYLOAD = [1, 2, 3]
end
# good
describe Something do
let(:payload) { [1, 2, 3] }
end
# bad
describe Something do
MyClass::PAYLOAD = [1, 2, 3]
end
# good
describe Something do
before { stub_const('MyClass::PAYLOAD', [1, 2, 3])
end