Sha256: 3f360b4c273fec50084ec91ce0ca6e557e6ab0e2aa2462ccc3b87f9f6851c98d

Contents?: true

Size: 833 Bytes

Versions: 11

Compression:

Stored size: 833 Bytes

Contents

require File.dirname(__FILE__) + "/../spec_helper"

describe IMW::Resource do

  describe "handling missing methods" do
    before do
      @resource = IMW::Resource.new('/home/foof.txt', :no_modules => true)
    end

    it "should return false when querying with a method that isn't defined" do
      @resource.is_remote?.should be_false
    end

    it "should raise an IMW::NoMethodError in any other case" do
      lambda { @resource.do_seomthing }.should raise_error(IMW::NoMethodError)
    end

    it "should print the modules it's been extended by when raising an IMW::NoMethodError" do
      begin
        @resource.extend(IMW::Schemes::Local::Base)
        @resource.do_something
      rescue IMW::NoMethodError => e
        e.message.should match(/extended by IMW::Schemes::Local::Base/)
      end
    end
  end

end




Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
imw-0.2.18 spec/imw/resource_spec.rb
imw-0.2.17 spec/imw/resource_spec.rb
imw-0.2.16 spec/imw/resource_spec.rb
imw-0.2.15 spec/imw/resource_spec.rb
imw-0.2.14 spec/imw/resource_spec.rb
imw-0.2.13 spec/imw/resource_spec.rb
imw-0.2.12 spec/imw/resource_spec.rb
imw-0.2.11 spec/imw/resource_spec.rb
imw-0.2.10 spec/imw/resource_spec.rb
imw-0.2.9 spec/imw/resource_spec.rb
imw-0.2.8 spec/imw/resource_spec.rb