`its([:foo])` doesn't work when the subject is not a Hash
Created by: Peeja
It's awesome that you can say
subject { {foo: "bar"} }
its([:foo]) { should == "bar" }
It's less awesome that you can't say
subject { Nokogiri::HTML("<a href='http://example.com/'>Road to Nowhere</a>") }
its([:href]) { should == "http://example.com/" }
even though Nokogiri defines Nokogiri::XML::Node#[]
.
RSpec explicitly checks that the subject is a hash before making with the awesome. Is there a reason for that? I'm happy to change it and the tests, if there are no objections.