spec/plugin_spec.rb in cocoapods-keys-1.6.0 vs spec/plugin_spec.rb in cocoapods-keys-1.6.1

- old
+ new

@@ -39,29 +39,29 @@ end it 'adds Keys to the global Pod' do expect(@podfile).to receive(:pod).with('Keys', anything) - CocoaPodsKeys.add_keys_to_pods(Pathname.new('Pods/CocoaPodsKeys/'), {}) + CocoaPodsKeys.add_keys_to_pods(@podfile, Pathname.new('Pods/CocoaPodsKeys/'), {}) end %w(target targets).each do |target_tag| context "with a non-existant target specified as a string in '#{target_tag}'" do it 'fails to assign the key to the tag' do expect(@podfile).not_to receive(:pod).with('Keys', anything) expect(Pod::UI).to receive(:puts).with('Could not find a target named \'TargetA\' in your Podfile. Stopping keys'.red) - CocoaPodsKeys.add_keys_to_pods(Pathname.new('Pods/CocoaPodsKeys/'), target_tag => 'TargetA') + CocoaPodsKeys.add_keys_to_pods(@podfile, Pathname.new('Pods/CocoaPodsKeys/'), target_tag => 'TargetA') end end context "with a non-existant target specified as an array in '#{target_tag}'" do it 'fails to assign the key to the tag' do expect(@podfile).not_to receive(:pod).with('Keys', anything) expect(Pod::UI).to receive(:puts).with('Could not find a target named \'TargetA\' in your Podfile. Stopping keys'.red) - CocoaPodsKeys.add_keys_to_pods(Pathname.new('Pods/CocoaPodsKeys/'), target_tag => ['TargetA']) + CocoaPodsKeys.add_keys_to_pods(@podfile, Pathname.new('Pods/CocoaPodsKeys/'), target_tag => ['TargetA']) end end end end @@ -78,48 +78,48 @@ context 'with no targets specified' do it 'adds Keys to the global Pod' do expect(@podfile).to receive(:pod).with('Keys', anything) expect(@target_a).not_to receive(:store_pod).with('Keys', anything) - CocoaPodsKeys.add_keys_to_pods(Pathname.new('Pods/CocoaPodsKeys/'), {}) + CocoaPodsKeys.add_keys_to_pods(@podfile, Pathname.new('Pods/CocoaPodsKeys/'), {}) end end %w(target targets).each do |target_tag| context "with a string specified in '#{target_tag}'" do it 'adds Keys to the target' do expect(@podfile).not_to receive(:pod).with('Keys', anything) expect(@target_a).to receive(:store_pod).with('Keys', anything) - CocoaPodsKeys.add_keys_to_pods(Pathname.new('Pods/CocoaPodsKeys/'), target_tag => 'TargetA') + CocoaPodsKeys.add_keys_to_pods(@podfile, Pathname.new('Pods/CocoaPodsKeys/'), target_tag => 'TargetA') end end context "with an array specified in '#{target_tag}'" do it 'adds Keys to the target' do expect(@podfile).not_to receive(:pod).with('Keys', anything) expect(@target_a).to receive(:store_pod).with('Keys', anything) - CocoaPodsKeys.add_keys_to_pods(Pathname.new('Pods/CocoaPodsKeys/'), target_tag => ['TargetA']) + CocoaPodsKeys.add_keys_to_pods(@podfile, Pathname.new('Pods/CocoaPodsKeys/'), target_tag => ['TargetA']) end end context "with a non-existant target specified as a string in '#{target_tag}'" do it 'fails to assign the key to the tag' do expect(@podfile).not_to receive(:pod).with('Keys', anything) expect(Pod::UI).to receive(:puts).with('Could not find a target named \'TargetB\' in your Podfile. Stopping keys'.red) - CocoaPodsKeys.add_keys_to_pods(Pathname.new('Pods/CocoaPodsKeys/'), target_tag => 'TargetB') + CocoaPodsKeys.add_keys_to_pods(@podfile, Pathname.new('Pods/CocoaPodsKeys/'), target_tag => 'TargetB') end end context "with a non-existant target specified as an array in '#{target_tag}'" do it 'fails to assign the key to the tag' do expect(@podfile).not_to receive(:pod).with('Keys', anything) expect(Pod::UI).to receive(:puts).with('Could not find a target named \'TargetB\' in your Podfile. Stopping keys'.red) - CocoaPodsKeys.add_keys_to_pods(Pathname.new('Pods/CocoaPodsKeys/'), target_tag => ['TargetB']) + CocoaPodsKeys.add_keys_to_pods(@podfile, Pathname.new('Pods/CocoaPodsKeys/'), target_tag => ['TargetB']) end end end end @@ -137,69 +137,69 @@ it 'adds Keys to the global Pod' do expect(@podfile).to receive(:pod).with('Keys', anything) expect(@target_a).not_to receive(:store_pod).with('Keys', anything) expect(@target_b).not_to receive(:store_pod).with('Keys', anything) - CocoaPodsKeys.add_keys_to_pods(Pathname.new('Pods/CocoaPodsKeys/'), {}) + CocoaPodsKeys.add_keys_to_pods(@podfile, Pathname.new('Pods/CocoaPodsKeys/'), {}) end end %w(target targets).each do |target_tag| context "with 'TargetA' specified as a string in '#{target_tag}'" do it 'adds Keys to Target A' do expect(@podfile).not_to receive(:pod).with('Keys', anything) expect(@target_a).to receive(:store_pod).with('Keys', anything) expect(@target_b).not_to receive(:store_pod).with('Keys', anything) - CocoaPodsKeys.add_keys_to_pods(Pathname.new('Pods/CocoaPodsKeys/'), target_tag => 'TargetA') + CocoaPodsKeys.add_keys_to_pods(@podfile, Pathname.new('Pods/CocoaPodsKeys/'), target_tag => 'TargetA') end end context "with 'TargetA' specified in an array in '#{target_tag}'" do it 'adds Keys to Target A' do expect(@podfile).not_to receive(:pod).with('Keys', anything) expect(@target_a).to receive(:store_pod).with('Keys', anything) expect(@target_b).not_to receive(:store_pod).with('Keys', anything) - CocoaPodsKeys.add_keys_to_pods(Pathname.new('Pods/CocoaPodsKeys/'), target_tag => ['TargetA']) + CocoaPodsKeys.add_keys_to_pods(@podfile, Pathname.new('Pods/CocoaPodsKeys/'), target_tag => ['TargetA']) end end context "with 'TargetA' specified as a string in '#{target_tag}'" do it 'adds Keys to Target B' do expect(@podfile).not_to receive(:pod).with('Keys', anything) expect(@target_a).not_to receive(:store_pod).with('Keys', anything) expect(@target_b).to receive(:store_pod).with('Keys', anything) - CocoaPodsKeys.add_keys_to_pods(Pathname.new('Pods/CocoaPodsKeys/'), target_tag => 'TargetB') + CocoaPodsKeys.add_keys_to_pods(@podfile, Pathname.new('Pods/CocoaPodsKeys/'), target_tag => 'TargetB') end end context "with 'TargetB' specified in an array in '#{target_tag}'" do it 'adds Keys to Target B' do expect(@podfile).not_to receive(:pod).with('Keys', anything) expect(@target_a).not_to receive(:store_pod).with('Keys', anything) expect(@target_b).to receive(:store_pod).with('Keys', anything) - CocoaPodsKeys.add_keys_to_pods(Pathname.new('Pods/CocoaPodsKeys/'), target_tag => ['TargetB']) + CocoaPodsKeys.add_keys_to_pods(@podfile, Pathname.new('Pods/CocoaPodsKeys/'), target_tag => ['TargetB']) end end context "with a non-existant target specified as a string in '#{target_tag}'" do it 'fails to assign the key to the tag' do expect(@podfile).not_to receive(:pod).with('Keys', anything) expect(Pod::UI).to receive(:puts).with('Could not find a target named \'TargetC\' in your Podfile. Stopping keys'.red) - CocoaPodsKeys.add_keys_to_pods(Pathname.new('Pods/CocoaPodsKeys/'), target_tag => 'TargetC') + CocoaPodsKeys.add_keys_to_pods(@podfile, Pathname.new('Pods/CocoaPodsKeys/'), target_tag => 'TargetC') end end context "with a non-existant target specified as an array in '#{target_tag}'" do it 'fails to assign the key to the tag' do expect(@podfile).not_to receive(:pod).with('Keys', anything) expect(Pod::UI).to receive(:puts).with('Could not find a target named \'TargetC\' in your Podfile. Stopping keys'.red) - CocoaPodsKeys.add_keys_to_pods(Pathname.new('Pods/CocoaPodsKeys/'), target_tag => ['TargetC']) + CocoaPodsKeys.add_keys_to_pods(@podfile, Pathname.new('Pods/CocoaPodsKeys/'), target_tag => ['TargetC']) end end end end end