earlgrey 0.0.8 → 0.0.9

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: 02fa8958c3c796f4286ae8d8470b833bb39390de
4
- data.tar.gz: ea7e9627197aefffd7b508db177c638b46110587
3
+ metadata.gz: 01d2551c5ab8e45b99bae72609f18eef5c850254
4
+ data.tar.gz: d61567b0e24731ff80fbfe70de49b9dd9928444a
5
5
  SHA512:
6
- metadata.gz: 1b6e95a222326594ca32a66c4949014115fa7aa0053e7c5d0692ab2838fe21f37a6260aac6da1adefbe1901e2befde8fb17b2037d3daf838b684b027afc820fb
7
- data.tar.gz: 4b471bf13f77c30e7dfff460c4179b6f32d40699062b16baca9cf916a14498f14c451b4aae10eaacbd7abe4576017e14712b9aca5b2a626ffaef3a628926b6e6
6
+ metadata.gz: eca3ab5658c323722269955165565188bd060a2f2ba367bc1349c9e877f02999fe3b6f7fe58e958589d7b476e19b20457635bdd07705257de65c16863f262a65
7
+ data.tar.gz: a16b767b4bcd7a3f047261df047bac952225443aece4afdedc4bdfaa0a70a6a25d70a5fbe3d6689f1b626a71749af5599807baefb78458ed0750a79cbf7a7de1
File without changes
@@ -19,24 +19,26 @@ module EarlGrey
19
19
  package_name 'EarlGrey'
20
20
 
21
21
  desc 'install', 'Installs EarlGrey into an Xcode unit test target'
22
+ method_option :carthage, type: :boolean, default: true
22
23
  method_option :project, aliases: '-p', type: :string, required: false, desc: 'Project'
23
- method_option :target, aliases: '-t', type: :string, required: true, desc: 'EarlGreyTestTarget'
24
24
  method_option :scheme, aliases: '-s', type: :string, required: false, desc: 'EarlGreyTestTarget.xcscheme'
25
- method_option :swift, type: :boolean, default: true
26
- method_option :carthage, type: :boolean, default: true
25
+ method_option :swift, type: :boolean, default: true
26
+ method_option :swift_version, type: :string, default: '3.0', enum: %w[2.2 3.0]
27
+ method_option :target, aliases: '-t', type: :string, required: true, desc: 'EarlGreyTestTarget'
27
28
 
28
29
  PROJECT = 'project'.freeze
29
30
  TARGET = 'target'.freeze
30
31
  SCHEME = 'scheme'.freeze
31
32
  SWIFT = 'swift'.freeze
32
33
  CARTHAGE = 'carthage'.freeze
34
+ SWIFT_VERSION = 'swift_version'.freeze
33
35
 
34
36
  def install
35
37
  o = options.dup
36
38
 
37
39
  # CLI will never use Cocoapod's `post_install do |installer|`
38
40
  podfile_installer = nil
39
- opts = { swift: o[SWIFT], carthage: o[CARTHAGE] }
41
+ opts = { swift: o[SWIFT], carthage: o[CARTHAGE], swift_version: o[SWIFT_VERSION] }
40
42
 
41
43
  # Use target as the default Scheme name.
42
44
  o[SCHEME] ||= o[TARGET]
@@ -21,7 +21,7 @@ end
21
21
  module EarlGrey
22
22
  class << self
23
23
  attr_reader :project_name, :test_target, :test_target_name, :scheme_file,
24
- :user_project, :swift, :carthage
24
+ :user_project, :carthage, :swift, :swift_version
25
25
 
26
26
  # Returns path to Xcode file, prepending current working dir if necessary.
27
27
  # @param xcode_file [String] xcode file path
@@ -66,6 +66,7 @@ module EarlGrey
66
66
  def set_defaults(installer, project_name, test_target_name, scheme_file, opts = {})
67
67
  @swift = opts.fetch(:swift, false)
68
68
  @carthage = opts.fetch(:carthage, false)
69
+ @swift_version = opts.fetch(:swift_version, '3.0')
69
70
 
70
71
  puts_blue "Checking and Updating #{project_name} for EarlGrey."
71
72
  pods_project = installer ? installer.pods_project : true
@@ -260,7 +261,7 @@ module EarlGrey
260
261
  framework_path = if carthage
261
262
  '${SRCROOT}/Carthage/Build/iOS/EarlGrey.framework'
262
263
  else
263
- '${SRCROOT}/Pods/EarlGrey/EarlGrey-1.0.0/EarlGrey.framework'
264
+ '${SRCROOT}/Pods/EarlGrey/EarlGrey/EarlGrey.framework'
264
265
  end
265
266
 
266
267
  framework_ref = user_project.products_group.files.find { |f| f.path == framework_path }
@@ -353,7 +354,8 @@ module EarlGrey
353
354
  dst_header = File.join(dst_root, src_header_name)
354
355
 
355
356
  src_swift_name = 'EarlGrey.swift'
356
- src_swift = File.join(src_root, src_swift_name)
357
+ src_swift = File.join(src_root, "Swift-#{swift_version}", src_swift_name)
358
+
357
359
  raise 'Bundled swift missing' unless File.exist? src_swift
358
360
  dst_swift = File.join(dst_root, src_swift_name)
359
361
 
@@ -0,0 +1,93 @@
1
+ //
2
+ // Copyright 2016 Google Inc.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ //
16
+
17
+ import EarlGrey
18
+
19
+ public func grey_allOfMatchers(args: AnyObject...) -> GREYMatcher! {
20
+ return GREYAllOf.init(matchers: args)
21
+ }
22
+
23
+ public func grey_anyOfMatchers(args: AnyObject...) -> GREYMatcher! {
24
+ return GREYAnyOf.init(matchers: args)
25
+ }
26
+
27
+ public func EarlGrey() -> EarlGreyImpl! {
28
+ return EarlGreyImpl.invokedFromFile(__FILE__, lineNumber: __LINE__)
29
+ }
30
+
31
+ public func GREYAssert(@autoclosure expression: () -> BooleanType, reason: String) {
32
+ GREYAssert(expression, reason, details: "Expected expression to be true")
33
+ }
34
+
35
+ public func GREYAssertTrue(@autoclosure expression: () -> BooleanType, reason: String) {
36
+ GREYAssert(expression().boolValue,
37
+ reason,
38
+ details: "Expected the boolean expression to be true")
39
+ }
40
+
41
+ public func GREYAssertFalse(@autoclosure expression: () -> BooleanType, reason: String) {
42
+ GREYAssert(!expression().boolValue,
43
+ reason,
44
+ details: "Expected the boolean expression to be false")
45
+ }
46
+
47
+ public func GREYAssertNotNil(@autoclosure expression: () -> Any?, reason: String) {
48
+ GREYAssert(expression() != nil, reason, details: "Expected expression to be not nil")
49
+ }
50
+
51
+ public func GREYAssertNil(@autoclosure expression: () -> Any?, reason: String) {
52
+ GREYAssert(expression() == nil, reason, details: "Expected expression to be nil")
53
+ }
54
+
55
+ public func GREYAssertEqual<T : Equatable>(@autoclosure left: () -> T?,
56
+ @autoclosure _ right: () -> T?, reason: String) {
57
+ GREYAssert(left() == right(), reason, details: "Expected left term to be equal to right term")
58
+ }
59
+
60
+ public func GREYAssertNotEqual<T : Equatable>(@autoclosure left: () -> T?,
61
+ @autoclosure _ right: () -> T?, reason: String) {
62
+ GREYAssert(left() != right(), reason, details: "Expected left term to not be equal to right term")
63
+ }
64
+
65
+ public func GREYFail(reason: String) {
66
+ greyFailureHandler.handleException(GREYFrameworkException(name: kGREYAssertionFailedException,
67
+ reason: reason),
68
+ details: "")
69
+ }
70
+
71
+ public func GREYFail(reason: String, details: String) {
72
+ greyFailureHandler.handleException(GREYFrameworkException(name: kGREYAssertionFailedException,
73
+ reason: reason),
74
+ details: details)
75
+ }
76
+
77
+ private func GREYAssert(@autoclosure expression: () -> BooleanType,
78
+ _ reason: String, details: String) {
79
+ GREYSetCurrentAsFailable()
80
+ if !expression().boolValue {
81
+ greyFailureHandler.handleException(GREYFrameworkException(name: kGREYAssertionFailedException,
82
+ reason: reason),
83
+ details: details)
84
+ }
85
+ }
86
+
87
+ private func GREYSetCurrentAsFailable() {
88
+ let greyFailureHandlerSelector =
89
+ Selector("GREYFailureHandler.setInvocationFile(__FILE__, andInvocationLine:__LINE__)")
90
+ if greyFailureHandler.respondsToSelector(greyFailureHandlerSelector) {
91
+ greyFailureHandler.setInvocationFile!(__FILE__, andInvocationLine: __LINE__)
92
+ }
93
+ }
@@ -14,18 +14,18 @@
14
14
  // limitations under the License.
15
15
  //
16
16
 
17
- public func EarlGrey() -> EarlGreyImpl! {
18
- return EarlGreyImpl.invokedFromFile(#file, lineNumber: #line)
19
- }
20
-
21
- func grey_allOfMatchers(args: AnyObject...) -> GREYMatcher! {
17
+ public func grey_allOfMatchers(args: AnyObject...) -> GREYMatcher! {
22
18
  return GREYAllOf.init(matchers: args)
23
19
  }
24
20
 
25
- func grey_anyOfMatchers(args: AnyObject...) -> GREYMatcher! {
21
+ public func grey_anyOfMatchers(args: AnyObject...) -> GREYMatcher! {
26
22
  return GREYAnyOf.init(matchers: args)
27
23
  }
28
24
 
25
+ public func EarlGrey() -> EarlGreyImpl! {
26
+ return EarlGreyImpl.invokedFromFile(#file, lineNumber: #line)
27
+ }
28
+
29
29
  public func GREYAssert(@autoclosure expression: () -> BooleanType, reason: String) {
30
30
  GREYAssert(expression, reason, details: "Expected expression to be true")
31
31
  }
@@ -39,7 +39,7 @@ public func GREYAssertTrue(@autoclosure expression: () -> BooleanType, reason: S
39
39
  public func GREYAssertFalse(@autoclosure expression: () -> BooleanType, reason: String) {
40
40
  GREYAssert(!expression().boolValue,
41
41
  reason,
42
- details: "Expected the boolean expression to be true")
42
+ details: "Expected the boolean expression to be false")
43
43
  }
44
44
 
45
45
  public func GREYAssertNotNil(@autoclosure expression: () -> Any?, reason: String) {
@@ -52,7 +52,12 @@ public func GREYAssertNil(@autoclosure expression: () -> Any?, reason: String) {
52
52
 
53
53
  public func GREYAssertEqual<T : Equatable>(@autoclosure left: () -> T?,
54
54
  @autoclosure _ right: () -> T?, reason: String) {
55
- GREYAssert(left() == right(), reason, details: "Expeted left term to be equal to right term")
55
+ GREYAssert(left() == right(), reason, details: "Expected left term to be equal to right term")
56
+ }
57
+
58
+ public func GREYAssertNotEqual<T : Equatable>(@autoclosure left: () -> T?,
59
+ @autoclosure _ right: () -> T?, reason: String) {
60
+ GREYAssert(left() != right(), reason, details: "Expected left term to not be equal to right term")
56
61
  }
57
62
 
58
63
  public func GREYFail(reason: String) {
@@ -83,4 +88,4 @@ private func GREYSetCurrentAsFailable() {
83
88
  if greyFailureHandler.respondsToSelector(greyFailureHandlerSelector) {
84
89
  greyFailureHandler.setInvocationFile!(#file, andInvocationLine: #line)
85
90
  }
86
- }
91
+ }
@@ -14,5 +14,5 @@
14
14
  # limitations under the License.
15
15
 
16
16
  module EarlGrey
17
- VERSION = '0.0.8'.freeze unless defined? ::EarlGrey::VERSION
17
+ VERSION = '0.0.9'.freeze unless defined? ::EarlGrey::VERSION
18
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: earlgrey
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - khandpur
@@ -10,118 +10,118 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-06-16 00:00:00.000000000 Z
13
+ date: 2016-08-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: colored
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - ">="
19
+ - - '>='
20
20
  - !ruby/object:Gem::Version
21
21
  version: '1.2'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - ">="
26
+ - - '>='
27
27
  - !ruby/object:Gem::Version
28
28
  version: '1.2'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: xcodeproj
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - ">="
33
+ - - '>='
34
34
  - !ruby/object:Gem::Version
35
35
  version: '1.0'
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - ">="
40
+ - - '>='
41
41
  - !ruby/object:Gem::Version
42
42
  version: '1.0'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: thor
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ">="
47
+ - - '>='
48
48
  - !ruby/object:Gem::Version
49
49
  version: 0.19.1
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - ">="
54
+ - - '>='
55
55
  - !ruby/object:Gem::Version
56
56
  version: 0.19.1
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: rspec
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
- - - ">="
61
+ - - '>='
62
62
  - !ruby/object:Gem::Version
63
63
  version: 3.4.0
64
64
  type: :development
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
- - - ">="
68
+ - - '>='
69
69
  - !ruby/object:Gem::Version
70
70
  version: 3.4.0
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: rubocop
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
- - - ">="
75
+ - - '>='
76
76
  - !ruby/object:Gem::Version
77
77
  version: 0.39.0
78
78
  type: :development
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
- - - ">="
82
+ - - '>='
83
83
  - !ruby/object:Gem::Version
84
84
  version: 0.39.0
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: coveralls
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
- - - "~>"
89
+ - - ~>
90
90
  - !ruby/object:Gem::Version
91
91
  version: 0.8.13
92
92
  type: :development
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
- - - "~>"
96
+ - - ~>
97
97
  - !ruby/object:Gem::Version
98
98
  version: 0.8.13
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: pry
101
101
  requirement: !ruby/object:Gem::Requirement
102
102
  requirements:
103
- - - "~>"
103
+ - - ~>
104
104
  - !ruby/object:Gem::Version
105
105
  version: 0.10.3
106
106
  type: :development
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
- - - "~>"
110
+ - - ~>
111
111
  - !ruby/object:Gem::Version
112
112
  version: 0.10.3
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: rake
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
- - - "~>"
117
+ - - ~>
118
118
  - !ruby/object:Gem::Version
119
119
  version: '11.1'
120
120
  type: :development
121
121
  prerelease: false
122
122
  version_requirements: !ruby/object:Gem::Requirement
123
123
  requirements:
124
- - - "~>"
124
+ - - ~>
125
125
  - !ruby/object:Gem::Version
126
126
  version: '11.1'
127
127
  description: Command line tool for installing EarlGrey into an iOS Unit Testing target
@@ -137,7 +137,8 @@ files:
137
137
  - lib/earlgrey/configure_earlgrey.rb
138
138
  - lib/earlgrey/earlgrey.rb
139
139
  - lib/earlgrey/files/BridgingHeader.h
140
- - lib/earlgrey/files/EarlGrey.swift
140
+ - lib/earlgrey/files/Swift-2.2/EarlGrey.swift
141
+ - lib/earlgrey/files/Swift-3.0/EarlGrey.swift
141
142
  - lib/earlgrey/version.rb
142
143
  homepage: https://github.com/google/EarlGrey
143
144
  licenses:
@@ -149,19 +150,18 @@ require_paths:
149
150
  - lib
150
151
  required_ruby_version: !ruby/object:Gem::Requirement
151
152
  requirements:
152
- - - ">="
153
+ - - '>='
153
154
  - !ruby/object:Gem::Version
154
155
  version: '2'
155
156
  required_rubygems_version: !ruby/object:Gem::Requirement
156
157
  requirements:
157
- - - ">="
158
+ - - '>='
158
159
  - !ruby/object:Gem::Version
159
160
  version: '0'
160
161
  requirements: []
161
162
  rubyforge_project:
162
- rubygems_version: 2.6.4
163
+ rubygems_version: 2.0.14.1
163
164
  signing_key:
164
165
  specification_version: 4
165
166
  summary: EarlGrey installer gem
166
167
  test_files: []
167
- has_rdoc: