Implicit subject should not use .new with modules

Fixes GitHub issue https://github.com/icy-arctic-fox/spectator/issues/6
This commit is contained in:
Michael Miller 2020-02-22 22:59:09 -07:00
parent f5f1361477
commit e92aa7ed57
2 changed files with 19 additions and 3 deletions

View file

@ -2,6 +2,8 @@ require "./spec_helper"
class Base; end
module SomeModule; end
Spectator.describe "Subject" do
subject { Base.new }
@ -10,4 +12,12 @@ Spectator.describe "Subject" do
expect(subject).to be_a(Base)
end
end
context "module" do
describe SomeModule do
it "sets the implicit subject to the module" do
expect(subject).to be(SomeModule)
end
end
end
end