sauce_rspec 1.0.0 → 1.0.1
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 +4 -4
- data/.rubocop.yml +2 -0
- data/lib/sauce_rspec/jenkins.rb +23 -9
- data/lib/sauce_rspec/rspec.rb +8 -1
- data/lib/sauce_rspec/version.rb +1 -1
- data/release_notes.md +7 -0
- data/sauce_rspec.gemspec +0 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e57be49a029f21900caeec78e159aa2ddab0d0ea
|
4
|
+
data.tar.gz: 601f97a26625b0c99f21944394ff0f458d858610
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f3fc22d0792b234d46a76f679234856b94dc9a3e55791817f91b55374105ae920bc03414f85b79f94257e3bc73556b48f0c37b3ea49c68bf667dd69c0775edf
|
7
|
+
data.tar.gz: 6c39cfe76a888823f59dff7f93e348e5fb42b3acf65b513240857dbc5a25a2974d3ea97cd6463aebdce42ea0fa1a05f3f77719b7f83f3985489a47f68740f7af
|
data/.rubocop.yml
CHANGED
data/lib/sauce_rspec/jenkins.rb
CHANGED
@@ -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
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
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
|
38
|
-
caps[:name]
|
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
|
-
|
54
|
+
meta[:full_description] += "\n#{' ' * 5 + browser_version_platform}"
|
55
|
+
meta[:description] += " - #{browser_version_platform}"
|
42
56
|
|
43
57
|
caps
|
44
58
|
end
|
data/lib/sauce_rspec/rspec.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/sauce_rspec/version.rb
CHANGED
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