knapsack 0.3.0 → 0.4.0

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: 181f987c696d1bc19a140cf92e482790f7b1c2ce
4
- data.tar.gz: 92a9cb85bb6a341ddd9dd572a8324875fd30ef4d
3
+ metadata.gz: bc477465c1e83c26805933d0aead7afb9dd5cd49
4
+ data.tar.gz: 73dc9071d26112fe9f7dc546aed93904bc553aac
5
5
  SHA512:
6
- metadata.gz: f9b0a1761048c7c9bd0dcd019e871bf98ac7f0551d10c3b9078f6f6d3dad25748a0450576cb5ae5d7d2be5f2748c8d3f71ab32034b289dddf6e7bc6b6b0b9091
7
- data.tar.gz: a976683e07452a987816f8036afdaa97db0254268d2cd503f462da0e2fa91c049553a670412d88e2fcc4d4a0f653f11a0d5ae616e8665ea43603beabd76e22a8
6
+ metadata.gz: f1151ac4215c86a36f7a0c977a7ec7fd7253cb4234afd83180ba18889891c6bde675423f83c03039b2ff45bea8c4e6dad4d4dd58e661b3b4b99e57a2ee6e8483
7
+ data.tar.gz: 79ac330dd040c46f2217f768a068eaa49e0470cc64ed64c2fe72e747fe2c42a0989f1b279e219ff9e56c04406244ed35580c072062013b10d94101895cb688ac
data/.gitignore CHANGED
@@ -20,3 +20,4 @@ tmp
20
20
  *.o
21
21
  *.a
22
22
  mkmf.log
23
+ .idea/
data/.travis.yml CHANGED
@@ -6,6 +6,7 @@ rvm:
6
6
  - 2.1.0
7
7
  - 2.1.1
8
8
  - 2.1.2
9
+ - 2.1.3
9
10
  addons:
10
11
  code_climate:
11
12
  repo_token: 38686058eed480dd0fcf8bce9015733e0bae88e44e30f4a1ac63df8aec2f86d8
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  * TODO
4
4
 
5
+ ### 0.4.0
6
+
7
+ * Add support for RSpec 2.
8
+
5
9
  ### 0.3.0
6
10
 
7
11
  * Add support for semaphoreapp.com thread ENV variables.
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [Knapsack, The K is silent](http://www.youtube.com/watch?v=-Ae590hensE)
2
+
1
3
  # ![Knapsack logo](docs/images/logos/knapsack-logo-@2.png)
2
4
 
3
5
  [![Gem Version](https://badge.fury.io/rb/knapsack.png)][gem_version]
@@ -10,10 +12,14 @@
10
12
  [codeclimate]: https://codeclimate.com/github/ArturT/knapsack
11
13
  [coverage]: https://codeclimate.com/github/ArturT/knapsack
12
14
 
13
- Parallel specs across CI server nodes based on each spec file's time execution. It generates a spec time execution report and uses it for future test runs.
15
+ **Knapsack splits tests across CI nodes and makes sure that tests will run comparable time on each node.**
16
+
17
+ Parallel specs across CI server nodes based on each spec file's time execution. Knapsack generates a spec time execution report and uses it for future test runs.
14
18
 
15
19
  Short [presentation](http://slides.com/arturt/knapsack) about gem.
16
20
 
21
+ **[Sign up](http://knapsack.launchrock.com) to get info about launch Knapsack Pro with more features and free access for beta users.**
22
+
17
23
  ### Without Knapsack
18
24
 
19
25
  ![Without Knapsack gem](docs/images/without_knapsack.png)
@@ -213,3 +219,9 @@ Specs in `spec_examples/leftover` take more than 3 seconds. This should cause a
213
219
  ## Acknowledgements
214
220
 
215
221
  Many thanks to [Małgorzata Nowak](https://github.com/informatykgosia) for beautiful logo.
222
+
223
+ ## Mentions
224
+
225
+ * Lunar Logic Blog | [Parallel your specs and don’t waste time](http://blog.lunarlogic.io/2014/parallel-your-specs-and-dont-waste-time/)
226
+ * Travis CI | [Parallelizing RSpec tests on multiple VMs](http://docs.travis-ci.com/user/speeding-up-the-build/#Parallelizing-RSpec-tests-on-multiple-VMs)
227
+ * Semaphore | [Running RSpec specs in parallel](https://semaphoreapp.com/docs/running-rspec-specs-in-threads.html)
Binary file
data/knapsack.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_development_dependency 'bundler', '~> 1.6'
22
22
  spec.add_development_dependency 'rake', '~> 0'
23
- spec.add_development_dependency 'rspec', '~> 3.0', '>= 3.0.0'
23
+ spec.add_development_dependency 'rspec', '~> 3.0', '>= 2.0.0'
24
24
  spec.add_development_dependency 'timecop', '~> 0'
25
25
  spec.add_development_dependency 'codeclimate-test-reporter', '~> 0'
26
26
  end
@@ -4,7 +4,13 @@ module Knapsack
4
4
  def bind_time_tracker
5
5
  ::RSpec.configure do |config|
6
6
  config.before(:each) do
7
- Knapsack.tracker.spec_path = RspecAdapter.spec_path
7
+ current_example_group =
8
+ if ::RSpec.respond_to?(:current_example)
9
+ ::RSpec.current_example.metadata[:example_group]
10
+ else
11
+ example.metadata
12
+ end
13
+ Knapsack.tracker.spec_path = RspecAdapter.spec_path(current_example_group)
8
14
  Knapsack.tracker.start_timer
9
15
  end
10
16
 
@@ -35,8 +41,7 @@ module Knapsack
35
41
  end
36
42
  end
37
43
 
38
- def self.spec_path
39
- example_group = ::RSpec.current_example.metadata[:example_group]
44
+ def self.spec_path(example_group)
40
45
  until example_group[:parent_example_group].nil?
41
46
  example_group = example_group[:parent_example_group]
42
47
  end
@@ -1,3 +1,3 @@
1
1
  module Knapsack
2
- VERSION = '0.3.0'
2
+ VERSION = '0.4.0'
3
3
  end
@@ -71,10 +71,8 @@ describe Knapsack::Adapters::RspecAdapter do
71
71
  end
72
72
 
73
73
  describe '.spec_path' do
74
- let(:current_example) { double }
75
- let(:metadata) do
74
+ let(:current_example_metadata) do
76
75
  {
77
- example_group: {
78
76
  file_path: '1_shared_example.rb',
79
77
  parent_example_group: {
80
78
  file_path: '2_shared_example.rb',
@@ -82,16 +80,10 @@ describe Knapsack::Adapters::RspecAdapter do
82
80
  file_path: 'a_spec.rb'
83
81
  }
84
82
  }
85
- }
86
83
  }
87
84
  end
88
85
 
89
- subject { described_class.spec_path }
90
-
91
- before do
92
- allow(::RSpec).to receive(:current_example).and_return(current_example)
93
- allow(current_example).to receive(:metadata).and_return(metadata)
94
- end
86
+ subject { described_class.spec_path(current_example_metadata) }
95
87
 
96
88
  it { should eql 'a_spec.rb' }
97
89
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knapsack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ArturT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-15 00:00:00.000000000 Z
11
+ date: 2014-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -47,7 +47,7 @@ dependencies:
47
47
  version: '3.0'
48
48
  - - ">="
49
49
  - !ruby/object:Gem::Version
50
- version: 3.0.0
50
+ version: 2.0.0
51
51
  type: :development
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
@@ -57,7 +57,7 @@ dependencies:
57
57
  version: '3.0'
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
- version: 3.0.0
60
+ version: 2.0.0
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: timecop
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -105,7 +105,9 @@ files:
105
105
  - Rakefile
106
106
  - TODO.md
107
107
  - docs/images/logos/knapsack-@2.png
108
+ - docs/images/logos/knapsack-big.png
108
109
  - docs/images/logos/knapsack-logo-@2.png
110
+ - docs/images/logos/knapsack-logo-big.png
109
111
  - docs/images/logos/knapsack-logo.png
110
112
  - docs/images/logos/knapsack.png
111
113
  - docs/images/with_knapsack.png