Class: Yolo::Tasks::Ios::OCUnit
- Defined in:
- lib/yolo/tasks/ios/ocunit.rb
Overview
Executes all OCunit related tasks
Instance Attribute Summary collapse
-
#test_output ⇒ Object
the test_output type used when running tests, currently only supports :junit.
Instance Method Summary collapse
-
#build_opts_string(*additional_opts) ⇒ String
Overrides the superclass build_opts_string method and appends a pipe if test_ouput is defined.
-
#define ⇒ Object
Defines rake tasks available to the OCUnit class.
-
#initialize ⇒ OCUnit
constructor
Initializes the class with default settings.
-
#scheme ⇒ String
Returns the ocunit class’s scheme attribute, if no attribute is set then check for the scheme env var.
Methods inherited from BaseTask
Constructor Details
#initialize ⇒ OCUnit
Initializes the class with default settings
18 19 20 21 22 |
# File 'lib/yolo/tasks/ios/ocunit.rb', line 18 def initialize self.sdk = "iphonesimulator" unless sdk self.test_output = :junit super end |
Instance Attribute Details
#test_output ⇒ Object
the test_output type used when running tests, currently only supports :junit
13 14 15 |
# File 'lib/yolo/tasks/ios/ocunit.rb', line 13 def test_output @test_output end |
Instance Method Details
#build_opts_string(*additional_opts) ⇒ String
Overrides the superclass build_opts_string method and appends a pipe if test_ouput is defined
pipe appended if defined
32 33 34 35 36 |
# File 'lib/yolo/tasks/ios/ocunit.rb', line 32 def build_opts_string(*additional_opts) = build_opts + additional_opts = << "2>&1 | ocunit2junit" if test_output == :junit return .compact.join(" ") end |
#define ⇒ Object
Defines rake tasks available to the OCUnit class
56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/yolo/tasks/ios/ocunit.rb', line 56 def define super namespace :yolo do namespace :ocunit do desc "Runs the specified scheme(s) OCUnit tests." task :test do xcodebuild :clean xcodebuild :build end end end end |
#scheme ⇒ String
Returns the ocunit class’s scheme attribute, if no attribute is set then check for the scheme env var
43 44 45 46 47 48 49 50 51 |
# File 'lib/yolo/tasks/ios/ocunit.rb', line 43 def scheme scheme = @scheme if !scheme scheme = ENV['YOLO_OCUNIT_SCHEME'] end return scheme end |