xctasks 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 472cf85ba08b34c55b5cb6dcd65cac25038919d2
4
- data.tar.gz: 30d6fe3ad43e5924c01b30c59b5b85a36f0d833e
3
+ metadata.gz: 44c29bdc01e0cd8764098668cd35d90d008c8430
4
+ data.tar.gz: e5320e35f36890b7a3d1c41ca7c9c94dc94291e5
5
5
  SHA512:
6
- metadata.gz: 3db2ed26cc1c4704cd5c3f26f23a56c9a9cec22313afd189822e0ee1ceae308ae7a678009395d346859c326858aeecab698949b37f3afaf1036f468b9717ec27
7
- data.tar.gz: 8f707453304939b36a119eb142483ce9404a5208cbad9392ed78116240d67dfeb4ea16ae8c6c11632d1472f29c3c1cc070ed9923427e6d7009c3970523f17c26
6
+ metadata.gz: 3ee30720c15e74fab78fe11e83a3e93f864f73e728eb48a32da3efb0290e221beba7d914812fceb594679339fa67e748e6348715b3f41e8cb62cb6323303550c
7
+ data.tar.gz: 830d2731cab1d7200fd60feebd63bc4c744e9fae1f0616fdb929b57170a20c1776562022056d3ec5a3296fca29a181341769eb2dba1789a69f927d3059e7a51a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # XCTasks Changelog
2
2
 
3
+ ## v0.2.2
4
+
5
+ * Added pre-flight validation of workspace and schemes dir
6
+
7
+ ## v0.2.1
8
+
9
+ * Restore terminal output color to normal after reporting test results.
10
+
3
11
  ## v0.2.0
4
12
 
5
13
  * Further refinements to shell escaping [@tayhalla]
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- xctasks (0.2.1)
4
+ xctasks (0.2.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -293,6 +293,8 @@ module XCTasks
293
293
  def define_rake_tasks
294
294
  namespace self.namespace_name do
295
295
  task (prepare_dependency ? { prepare: prepare_dependency} : :prepare ) do
296
+ fail "No such workspace: #{workspace}" unless File.exists?(workspace)
297
+ fail "Invalid schemes directory: #{schemes_dir}" unless schemes_dir.nil? || File.exists?(schemes_dir)
296
298
  File.truncate(output_log, 0) if output_log && File.exists?(output_log)
297
299
  if schemes_dir
298
300
  FileUtils::Verbose.mkdir_p "#{workspace}/xcshareddata/xcschemes"
@@ -1,3 +1,3 @@
1
1
  module XCTasks
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -1,5 +1,6 @@
1
1
  require 'spec_helper'
2
2
  require 'xctasks/test_task'
3
+ require 'tempfile'
3
4
 
4
5
  describe XCTasks::TestTask do
5
6
  before(:each) do
@@ -15,10 +16,65 @@ describe XCTasks::TestTask do
15
16
  end
16
17
 
17
18
  Rake.application = rake
19
+
20
+ Dir.mktmpdir.tap do |path|
21
+ FileUtils.touch(path + '/LayerKit.xcworkspace')
22
+ FileUtils.mkdir_p(path + '/Tests/Schemes')
23
+ Dir.chdir(path)
24
+ end
18
25
  end
19
26
 
20
27
  let(:rake) { Rake::Application.new }
21
28
 
29
+ describe "test:prepare" do
30
+ subject { Rake.application['test:prepare'] }
31
+
32
+ context "when the given workspace does not exist" do
33
+ let!(:task) do
34
+ XCTasks::TestTask.new do |t|
35
+ t.workspace = 'Invalid.xcworkspace'
36
+ t.schemes_dir = 'Tests/Schemes'
37
+ t.runner = :xcpretty
38
+ t.subtasks = { unit: 'Unit Tests', functional: 'Functional Tests' }
39
+ end
40
+ end
41
+
42
+ it "fails" do
43
+ expect { subject.invoke }.to raise_error(RuntimeError, "No such workspace: Invalid.xcworkspace")
44
+ end
45
+ end
46
+
47
+ context "when the given schemes_dir is nil" do
48
+ let!(:task) do
49
+ XCTasks::TestTask.new do |t|
50
+ t.workspace = 'LayerKit.xcworkspace'
51
+ t.schemes_dir = nil
52
+ t.runner = :xcpretty
53
+ t.subtasks = { unit: 'Unit Tests', functional: 'Functional Tests' }
54
+ end
55
+ end
56
+
57
+ it "succeeds" do
58
+ expect { subject.invoke }.not_to raise_error
59
+ end
60
+ end
61
+
62
+ context "when the given schemes_dir does not exist" do
63
+ let!(:task) do
64
+ XCTasks::TestTask.new do |t|
65
+ t.workspace = 'LayerKit.xcworkspace'
66
+ t.schemes_dir = 'this/path/is/invalid'
67
+ t.runner = :xcpretty
68
+ t.subtasks = { unit: 'Unit Tests', functional: 'Functional Tests' }
69
+ end
70
+ end
71
+
72
+ it "fails" do
73
+ expect { subject.invoke }.to raise_error(RuntimeError, "Invalid schemes directory: this/path/is/invalid")
74
+ end
75
+ end
76
+ end
77
+
22
78
  describe 'simple task' do
23
79
  let!(:task) do
24
80
  XCTasks::TestTask.new do |t|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xctasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blake Watters
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-30 00:00:00.000000000 Z
11
+ date: 2014-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler