sauce_rspec 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6118697de5f852ffb2ee30ca8283da7ea72cd15e
4
- data.tar.gz: 890e2ee14a288fbe95e1fc9de22e1c0d12bddd3c
3
+ metadata.gz: e57be49a029f21900caeec78e159aa2ddab0d0ea
4
+ data.tar.gz: 601f97a26625b0c99f21944394ff0f458d858610
5
5
  SHA512:
6
- metadata.gz: 58517296edb033301ddcd1a7ea729b798bc19fa5e82f92431a4aa6b051eef889342469025b89141bd9aaaa7a81add86c522f0cff4b18ad7e0e77efad358a5a37
7
- data.tar.gz: 6ca53ddbb1bfda50e4a822a5f76cbee74f9b263d17eae68628ee059d3dc50d9ef7f29405e6c5403e6f5a26d599819fa23cecbaa6539a8821c2465a5c85f147e3
6
+ metadata.gz: 8f3fc22d0792b234d46a76f679234856b94dc9a3e55791817f91b55374105ae920bc03414f85b79f94257e3bc73556b48f0c37b3ea49c68bf667dd69c0775edf
7
+ data.tar.gz: 6c39cfe76a888823f59dff7f93e348e5fb42b3acf65b513240857dbc5a25a2974d3ea97cd6463aebdce42ea0fa1a05f3f77719b7f83f3985489a47f68740f7af
data/.rubocop.yml CHANGED
@@ -10,3 +10,5 @@ Metrics/AbcSize:
10
10
  Enabled: false
11
11
  Style/RescueModifier:
12
12
  Enabled: false
13
+ Style/SpaceAroundOperators:
14
+ Enabled: false
@@ -26,19 +26,33 @@ module SauceRSpec
26
26
  # Returns the caps for the current RSpec example with the Sauce Labs
27
27
  # job name set.
28
28
  def update_example_caps
29
- example = RSpec.current_example
30
- caps = example.metadata[:caps]
31
- description = example.full_description
32
- browser = caps[:browserName].capitalize
33
- version = caps[:platformVersion] || caps[:version]
34
- platform = caps[:platformName] || caps[:platform]
29
+ example = RSpec.current_example
30
+ meta = example.metadata
31
+
32
+ # Store a copy of the original description if it's not already saved.
33
+ unless meta[:old_full_description]
34
+ meta[:old_description] = example.description
35
+ meta[:old_full_description] = example.full_description
36
+ end
37
+
38
+ # Reset the description to ensure previous runs don't mess with the value
39
+ meta[:description] = meta[:old_description]
40
+ meta[:full_description] = meta[:old_full_description]
41
+
42
+ caps = example.caps
43
+ full_description = example.full_description
44
+
45
+ browser = caps[:browserName].capitalize
46
+ version = caps[:platformVersion] || caps[:version]
47
+ platform = caps[:platformName] || caps[:platform]
35
48
 
36
49
  # Set Sauce Labs job_name
37
- browser_version_platform = [browser, version, '-', platform].join ' '
38
- caps[:name] = [description, '-', browser_version_platform].join ' '
50
+ browser_version_platform = [browser, version, '-', platform].join ' '
51
+ caps[:name] = [full_description, '-', browser_version_platform].join ' '
39
52
 
40
53
  # Add browser info to full description for RSpec progress reporter.
41
- example.metadata[:full_description] += "\n#{' ' * 5 + browser_version_platform}"
54
+ meta[:full_description] += "\n#{' ' * 5 + browser_version_platform}"
55
+ meta[:description] += " - #{browser_version_platform}"
42
56
 
43
57
  caps
44
58
  end
@@ -2,6 +2,11 @@ require 'rspec'
2
2
 
3
3
  module RSpec
4
4
  module Core
5
+ class Example
6
+ # metadata is memoized so define a custom caps method.
7
+ attr_accessor :caps
8
+ end
9
+
5
10
  class World
6
11
  alias_method :rspec_register, :register
7
12
 
@@ -22,7 +27,9 @@ module RSpec
22
27
  ex_with_cap = ex.clone
23
28
  new_id = "#{ex_with_cap.id}_#{index}_#{cap}"
24
29
  ex_with_cap.instance_variable_set(:@id, new_id)
25
- ex_with_cap.metadata[:caps] = cap
30
+ # can *not* use metadata[:caps] because rspec will memoize the
31
+ # value and then reuse it for all the examples.
32
+ ex_with_cap.caps = cap
26
33
  new_examples << ex_with_cap
27
34
  end
28
35
  end
@@ -1,4 +1,4 @@
1
1
  module SauceRSpec
2
- VERSION = '1.0.0' unless defined? ::SauceRSpec::VERSION
2
+ VERSION = '1.0.1' unless defined? ::SauceRSpec::VERSION
3
3
  DATE = '2015-10-08' unless defined? ::SauceRSpec::DATE
4
4
  end
data/release_notes.md CHANGED
@@ -1,3 +1,10 @@
1
+ #### v1.0.1 2015-10-08
2
+
3
+ - [52bcf9f](https://github.com/bootstraponline/sauce_rspec/commit/52bcf9fd9dc970122a42fb7eb407de2a9ff37db5) Release 1.0.1
4
+ - [81342e7](https://github.com/bootstraponline/sauce_rspec/commit/81342e78c43af3cef72d354a98ae0b7dde3779c2) Fix rubocop offenses
5
+ - [e46c384](https://github.com/bootstraponline/sauce_rspec/commit/e46c3843342c0f0ff403b256834ac99e42e323b7) Fix caps method. Update example description
6
+
7
+
1
8
  #### v1.0.0 2015-10-08
2
9
 
3
10
  - [2f88cc8](https://github.com/bootstraponline/sauce_rspec/commit/2f88cc8df603b184074d14454a7e96636c4e1114) Release 1.0.0
data/sauce_rspec.gemspec CHANGED
@@ -1,7 +1,5 @@
1
1
  require_relative 'lib/sauce_rspec/version'
2
2
 
3
- # rubocop:disable Style/SpaceAroundOperators
4
-
5
3
  Gem::Specification.new do |spec|
6
4
  spec.required_ruby_version = '>= 2.2.2'
7
5
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sauce_rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - code@bootstraponline.com