The simple code I'm using to test this is:

Berksfile

    site :opscode
    cookbook 'yum'

test.rb

    require 'berkshelf'

    b = Berkshelf::Berksfile.from_file(File.join(File.dirname(__FILE__), 'Berksfile'))

    puts b.sources.first.cached_cookbook.nil?
    puts b.sources.first.location.nil?
    Berkshelf::Resolver.new(b, sources: b.sources)

    puts b.sources.first.cached_cookbook.nil?
    puts b.sources.first.location.nil?
    Berkshelf::Resolver.new(b, sources: b.sources)

    puts b.sources.first.cached_cookbook.nil?
    puts b.sources.first.location.nil?

which outputs:

    true
    true
    Using yum (2.1.0)
    false
    true
    Using yum (2.1.0)
    false
    true