Thanks, Dewey! That got it working. Here is the first iteration, sort of copied from Dewey's example: before do @chef_run = ::ChefSpec::ChefRunner.new.converge 'x2go::default' end it 'should create a repo if it does not exists' do resource = @chef_run.find_resource("yum_repository", "x2go").to_hash expect(resource).to include( :repo_name => 'x2go', :description => 'x2go (replaces NX)', :key => "http://download.opensuse.org/repositories/X11:/RemoteDesktop:/x2go/RHEL_6/repodata/repomd.xml.key", :action =">" [:add] ) end Because I don't want to completely copy other people's code, here is my version: let(:chef_run) { ChefSpec::ChefRunner.new.converge 'x2go::default' } it 'should create a repo if it does not exists' do expect(chef_run.find_resource('yum_repository','x2go').to_hash).to include( :repo_name => 'x2go', :description => 'x2go (replaces NX)', :key => "http://download.opensuse.org/repositories/X11:/RemoteDesktop:/x2go/RHEL_6/repodata/repomd.xml.key", :action =">" [:add] ) end On Sep 28, 2013, at 11:23 PM, John Dewey <
">
> wrote:
|
Archive powered by MHonArc 2.6.16.