spec/spec_helper.rb in groupdocs-1.1.0 vs spec/spec_helper.rb in groupdocs-1.2.0

- old
+ new

@@ -10,13 +10,25 @@ # shared examples Dir['spec/support/shared_examples/**/*.rb'].each { |file| file = file.sub(/spec\//, ''); require file } # matchers extension +RSpec::Matchers.define :have_accessor do |name| + match do |object| + object.should respond_to(:"#{name}") + object.should respond_to(:"#{name}=") + end +end RSpec::Matchers.define :have_alias do |aliased, original| match do |object| object.should respond_to(aliased) object.method(aliased).should == object.method(original) + end +end +RSpec::Matchers.define :alias_accessor do |aliased, original| + match do |object| + object.should have_alias(:"#{aliased}", :"#{original}") + object.should have_alias(:"#{aliased}=", :"#{original}=") end end # configure API access RSpec.configure do |spec|