earlgrey 0.0.4 → 0.0.5

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: 956e2568138465c89585c545e8fa3aafa5b846da
4
- data.tar.gz: f1b1122cc33bab6ea53045cbef4413ea95cd918b
3
+ metadata.gz: 0d7557e70415ea529dc8798d99d1e95cdd2c293e
4
+ data.tar.gz: b136a903e5e8240a135e9f1bdf00e42f21707061
5
5
  SHA512:
6
- metadata.gz: 4ccbd458b26a57c1b41c6abc25273f90aa30f68ec981678b327152848612d460fa339d5995b3caeaa89be6c3518b239af373bd6c26973b376110df059497ad38
7
- data.tar.gz: 3f25987e1861f2a31ffe586411e933ddfefe6bd967393bf52dada86a3e35729a638da28318bd4307f6dfddcb19df140f8bc6d85ae142a485a0d25a6c135b3644
6
+ metadata.gz: c8011f8f8e222be5bff18a0494debadb8271f63234c25eadd5a44e106b94bc7cd251a04e921a3c98585e733ff0dad1715a846c36a9e62f2d5900a5808011b933
7
+ data.tar.gz: a9851beaefc20fb8db5721c41efbc8826c578c2c945a40a58963a04767917605a76492d6a0f246e35a59234e5f69429ab0ca1f7fd851ce1e203cffa47d31b351
data/lib/earlgrey.rb CHANGED
@@ -1 +1,16 @@
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
+
1
16
  require_relative 'earlgrey/earlgrey'
data/lib/earlgrey/cli.rb CHANGED
@@ -13,6 +13,7 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
 
16
+ # rubocop:disable Metrics/LineLength
16
17
  module EarlGrey
17
18
  class CLI < Thor
18
19
  package_name 'EarlGrey'
@@ -84,13 +84,21 @@ module EarlGrey
84
84
  E
85
85
  end
86
86
 
87
+ # must reset state on every configure
88
+ @add_earlgrey_product = nil
89
+
87
90
  @project_name = project_name
88
91
  @test_target_name = test_target_name
89
92
  @scheme_file = File.basename(scheme_file, '.*') + '.xcscheme'
90
93
  @user_project = Xcodeproj::Project.open(project_file)
91
94
  all_targets = user_project.targets
92
95
  @test_target = all_targets.find { |target| target.name == test_target_name }
93
- raise "Unable to find target: #{test_target_name}. Targets are: #{all_targets.map(&:name)}" unless test_target
96
+ unless test_target
97
+ error <<-E
98
+ Unable to find target: #{test_target_name}.
99
+ Targets are: #{all_targets.map(&:name)}
100
+ E
101
+ end
94
102
 
95
103
  # Add a Test Action to the User Project Scheme.
96
104
  scheme = modify_scheme_for_actions
@@ -107,7 +115,10 @@ module EarlGrey
107
115
 
108
116
  save_earlgrey_scheme_changes(scheme) unless scheme.nil?
109
117
 
110
- puts_blue "EarlGrey setup complete. You can use the Test Target: #{test_target_name} for EarlGrey testing."
118
+ puts_blue <<-S
119
+ EarlGrey setup complete.
120
+ You can use the Test Target: #{test_target_name} for EarlGrey testing."
121
+ S
111
122
  end
112
123
 
113
124
  # Scheme changes to ensure that EarlGrey is correctly loaded before main() is called.
@@ -215,9 +226,10 @@ module EarlGrey
215
226
  # Add in the Environment Variables
216
227
  launch_action_env_vars.elements.each('EnvironmentVariable') do |launch_action_env_var|
217
228
  environment_variable = REXML::Element.new 'EnvironmentVariable'
218
- environment_variable.attributes['key'] = launch_action_env_var.attributes['key']
219
- environment_variable.attributes['value'] = launch_action_env_var.attributes['value']
220
- environment_variable.attributes['isEnabled'] = launch_action_env_var.attributes['isEnabled']
229
+ launch_attributes = launch_action_env_var.attributes
230
+ environment_variable.attributes['key'] = launch_attributes['key']
231
+ environment_variable.attributes['value'] = launch_attributes['value']
232
+ environment_variable.attributes['isEnabled'] = launch_attributes['isEnabled']
221
233
  test_action_env_vars.add_element(environment_variable)
222
234
  end
223
235
 
@@ -264,7 +276,8 @@ module EarlGrey
264
276
  end
265
277
 
266
278
  unless earlgrey_copy_files_exists
267
- new_copy_files_phase = test_target.new_copy_files_build_phase(earlgrey_copy_files_phase_name)
279
+ name = earlgrey_copy_files_phase_name
280
+ new_copy_files_phase = test_target.new_copy_files_build_phase(name)
268
281
  new_copy_files_phase.dst_path = '$(TEST_HOST)/../'
269
282
  new_copy_files_phase.dst_subfolder_spec = '0'
270
283
 
@@ -339,7 +352,8 @@ module EarlGrey
339
352
  FileUtils.copy src_header, dst_header
340
353
  FileUtils.copy src_swift, dst_swift
341
354
 
342
- test_target_group = user_project.main_group.children.find { |g| g.display_name == test_target_name }
355
+ project_test_targets = user_project.main_group.children
356
+ test_target_group = project_test_targets.find { |g| g.display_name == test_target_name }
343
357
  raise "Test target group not found! #{test_target_group}" unless test_target_group
344
358
 
345
359
  # Add files to testing target group otherwise Xcode can't read them.
@@ -354,7 +368,8 @@ module EarlGrey
354
368
  # Add EarlGrey.swift to sources build phase
355
369
  existing_sources = test_target.source_build_phase.files.map(&:display_name)
356
370
  unless existing_sources.include? src_swift_name
357
- earlgrey_swift_file_ref = test_target_group.files.find { |f| f.display_name == src_swift_name }
371
+ target_files = test_target_group.files
372
+ earlgrey_swift_file_ref = target_files.find { |f| f.display_name == src_swift_name }
358
373
  raise 'EarlGrey.swift not found in testing target' unless earlgrey_swift_file_ref
359
374
  test_target.source_build_phase.add_file_reference earlgrey_swift_file_ref
360
375
  end
@@ -21,5 +21,5 @@ require 'thor'
21
21
  require 'fileutils'
22
22
 
23
23
  require_relative 'version'
24
- require_relative 'configure_earlgrey_pods'
24
+ require_relative 'configure_earlgrey'
25
25
  require_relative 'cli'
@@ -1 +1,16 @@
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
+
1
16
  #import <EarlGrey/EarlGrey.h>
@@ -14,10 +14,18 @@
14
14
  // limitations under the License.
15
15
  //
16
16
 
17
- public func EarlGrey() -> EarlGreyImpl {
17
+ public func EarlGrey() -> EarlGreyImpl! {
18
18
  return EarlGreyImpl.invokedFromFile(#file, lineNumber: #line)
19
19
  }
20
20
 
21
+ func grey_allOfMatchers(args: AnyObject...) -> GREYMatcher! {
22
+ return GREYAllOf.init(matchers: args)
23
+ }
24
+
25
+ func grey_anyOfMatchers(args: AnyObject...) -> GREYMatcher! {
26
+ return GREYAnyOf.init(matchers: args)
27
+ }
28
+
21
29
  public func GREYAssert(@autoclosure expression: () -> BooleanType, reason: String) {
22
30
  GREYAssert(expression, reason, details: "Expected expression to be true")
23
31
  }
@@ -75,4 +83,4 @@ private func GREYSetCurrentAsFailable() {
75
83
  if greyFailureHandler.respondsToSelector(greyFailureHandlerSelector) {
76
84
  greyFailureHandler.setInvocationFile!(#file, andInvocationLine: #line)
77
85
  }
78
- }
86
+ }
@@ -14,5 +14,5 @@
14
14
  # limitations under the License.
15
15
 
16
16
  module EarlGrey
17
- VERSION = '0.0.4'.freeze unless defined? ::EarlGrey::VERSION
17
+ VERSION = '0.0.5'.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.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - khandpur
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-05-15 00:00:00.000000000 Z
13
+ date: 2016-05-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: colored
@@ -32,14 +32,14 @@ dependencies:
32
32
  requirements:
33
33
  - - ">="
34
34
  - !ruby/object:Gem::Version
35
- version: 0.28.2
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
- version: 0.28.2
42
+ version: '1.0'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: thor
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -134,7 +134,7 @@ files:
134
134
  - bin/earlgrey
135
135
  - lib/earlgrey.rb
136
136
  - lib/earlgrey/cli.rb
137
- - lib/earlgrey/configure_earlgrey_pods.rb
137
+ - lib/earlgrey/configure_earlgrey.rb
138
138
  - lib/earlgrey/earlgrey.rb
139
139
  - lib/earlgrey/files/BridgingHeader.h
140
140
  - lib/earlgrey/files/EarlGrey.swift