Skip to content

Commit

Permalink
style nits per review
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenn Kaplan committed Jun 28, 2018
1 parent 07f7a56 commit 0a2137e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 3 additions & 5 deletions lib/xcodeproj/scheme/test_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def skipped_tests
# Set the list of SkippedTest this action will skip.
#
def skipped_tests=(tests)
@xml_element.delete_element('SkippedTests') unless @xml_element.elements['SkippedTests'].nil?
@xml_element.delete_element('SkippedTests')
if tests.nil?
return
end
Expand Down Expand Up @@ -258,10 +258,8 @@ def selected_tests
# Set the list of SelectedTest this action will run.
#
def selected_tests=(tests)
@xml_element.delete_element('SelectedTests') unless @xml_element.elements['SelectedTests'].nil?
if tests.nil?
return
end
@xml_element.delete_element('SelectedTests')
return if tests.nil?
entries = @xml_element.add_element('SelectedTests')
tests.each do |selected|
entries.add_element(selected.xml_element)
Expand Down
6 changes: 3 additions & 3 deletions spec/scheme/test_action_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ module Xcodeproj
test_ref.xml_element.name.should == 'TestableReference'
test_ref.xml_element.attributes.count.should == 1
test_ref.xml_element.attributes['skipped'].should == 'NO'
test_ref.randomized?.should.be.false?
test_ref.should.not.be.randomized?
end

it 'raises if created with an invalid XML node' do
Expand Down Expand Up @@ -256,7 +256,7 @@ module Xcodeproj
describe 'randomized' do
it '#randomized? detect a true value' do
@sut.xml_element.attributes['testExecutionOrdering'] = 'random'
@sut.randomized?.should == true
@sut.should.be.randomized?
end

it '#randomized? detect a false value' do
Expand All @@ -276,7 +276,7 @@ module Xcodeproj

it '#randomized= set false value' do
@sut.randomized = false
@sut.xml_element.attributes['testExecutionOrdering'].should.nil?
@sut.xml_element.attributes['testExecutionOrdering'].should.be.nil?
end
end
end
Expand Down

0 comments on commit 0a2137e

Please sign in to comment.