mbklein / equivalent-xml

Easy equivalency tests for Nokogiri and Oga XML
MIT License
94 stars 29 forks source link

Ensure ::X::Matchers namespace is defined before adding matchers #5

Closed benmacleod closed 12 years ago

benmacleod commented 12 years ago

Needed to make this change because we're using RSpec 1.x (which uses Spec namespace) but other gems we're using (Timewarp specifically) defined the RSpec namespace without regard for that, thus RSpec was defined, but RSpec::Matchers wasn't.

mbklein commented 12 years ago

Thanks for the heads up.

I think this patch will raise an exception if ::RSpec doesn't exist at all. It probably needs to check for both, e.g.

if defined?(::RSpec) and defined?(::RSpec::Matchers)

I'll try to get that done in the next few days.

benmacleod commented 12 years ago

Thanks Michael, you're probably right. This was enough to get me going.

And thanks for the gem, it's saved me a lot of mucking around.