spec/cf/cli/space/spaces_spec.rb in cf-0.6.1.rc3 vs spec/cf/cli/space/spaces_spec.rb in cf-0.6.1.rc4

- old
+ new

@@ -11,11 +11,13 @@ let(:client) { fake_client(:spaces => spaces, :current_organization => organization) } before do any_instance_of described_class do |cli| stub(cli).client { client } - stub(cli).precondition { nil } + stub(cli).check_logged_in + stub(cli).check_target + stub(cli).check_organization end end describe 'metadata' do let(:command) { Mothership.commands[:spaces] } @@ -36,11 +38,11 @@ end end subject { cf %W[spaces --#{bool_flag(:full)} --no-quiet] } - it 'should have the correct first two lines' do + it 'outputs that it is getting spaces' do subject stdout.rewind expect(stdout.readline).to match /Getting spaces.*OK/ expect(stdout.readline).to eq "\n" @@ -70,9 +72,17 @@ end end end context 'when there are spaces' do + it_should_behave_like "a_command_that_populates_organization" do + before do + any_instance_of described_class do |cli| + stub.proxy(cli).check_organization + end + end + end + context 'and the full flag is given' do let(:full) { true } it 'displays yaml-style output with all space details' do any_instance_of CF::Space::Spaces do |spaces|