knapsack 1.7.0 → 1.8.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: 1d9f16bd65a7c6af4fdd57f421108b1f3cc22008
4
- data.tar.gz: aca4f9264ed06bc1ca55ba107c4382d05f2821b9
3
+ metadata.gz: 2b17f8f22c07cec90c96b69733d76b3541e50688
4
+ data.tar.gz: 52faf95b024af94704b398ed3b20a2020d90d400
5
5
  SHA512:
6
- metadata.gz: eba6f582a89e2df694accf1b63b9d213c8db0781102276323514c41702837ee1749c775d912df95a5510704adf7ac3518acbd307311ac62475f68002ba867c00
7
- data.tar.gz: bc55f58146b90c4acaf835566be3e657341eca9c0653f64c47a908d1151725de4bb17d0cf55e4a28fb692d969870248b2151afcca1efa419b49e76c4a72519d0
6
+ metadata.gz: 2f6fa8d3d06a1976af851644f6e8c199847117326d1f65bfa1f1e8ae00d3eefb1ee806f04136db8e83aa301033a71c3dd2954d246dbbd6aefc1e1a9865dc21d2
7
+ data.tar.gz: e4c5859043ef81dab06791948db8b0f1c49f19eb4d6f880354c0a2ddb2d871f96650b84bdfa220f6ee531a55cb14c955b914959c39e1471e03253d43c80f65aa
@@ -2,6 +2,12 @@
2
2
 
3
3
  * TODO
4
4
 
5
+ ### 1.8.0
6
+
7
+ * Add support for older cucumber versions than 1.3
8
+
9
+ https://github.com/ArturT/knapsack/compare/v1.7.0...v1.8.0
10
+
5
11
  ### 1.7.0
6
12
 
7
13
  * Add ability to run tests from multiple directories
data/README.md CHANGED
@@ -72,6 +72,7 @@ Presentations about gem:
72
72
  - [How to generate knapsack report?](#how-to-generate-knapsack-report)
73
73
  - [What does "leftover specs" mean?](#what-does-leftover-specs-mean)
74
74
  - [How can I run tests from multiple directories?](#how-can-i-run-tests-from-multiple-directories)
75
+ - [How to update existing knapsack report for a few test files?](#how-to-update-existing-knapsack-report-for-a-few-test-files)
75
76
  - [Gem tests](#gem-tests)
76
77
  - [Spec](#spec)
77
78
  - [Spec examples](#spec-examples)
@@ -545,6 +546,10 @@ The test file pattern config option supports any glob pattern handled by [`Dir.g
545
546
 
546
547
  $ KNAPSACK_TEST_DIR=spec KNAPSACK_TEST_FILE_PATTERN="{spec,engines/**/spec}/**{,/*/**}/*_spec.rb" bundle exec rake knapsack:rspec
547
548
 
549
+ ### How to update existing knapsack report for a few test files?
550
+
551
+ You may want to look at monkey patch in [this issue](https://github.com/ArturT/knapsack/issues/34). Take into account that there are some cons of this approach.
552
+
548
553
  ## Gem tests
549
554
 
550
555
  ### Spec
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency 'bundler', '~> 1.6'
25
25
  spec.add_development_dependency 'rspec', '~> 3.0', '>= 2.0.0'
26
26
  spec.add_development_dependency 'rspec-its', '~> 1.2'
27
- spec.add_development_dependency 'cucumber', '>= 1.3'
27
+ spec.add_development_dependency 'cucumber', '>= 0'
28
28
  spec.add_development_dependency 'minitest', '>= 5.0.0'
29
29
  spec.add_development_dependency 'codeclimate-test-reporter', '~> 0'
30
30
  spec.add_development_dependency 'pry', '~> 0'
@@ -35,11 +35,22 @@ module Knapsack
35
35
  test_case = object
36
36
  test_case.location.file
37
37
  else
38
- scenario_or_outline_table = object
39
- if scenario_or_outline_table.respond_to?(:file)
40
- scenario_or_outline_table.file
38
+ if object.respond_to?(:scenario_outline)
39
+ if object.scenario_outline.respond_to?(:feature)
40
+ # Cucumber < 1.3
41
+ object.scenario_outline.feature.file
42
+ else
43
+ # Cucumber >= 1.3
44
+ object.scenario_outline.file
45
+ end
41
46
  else
42
- scenario_or_outline_table.scenario_outline.file
47
+ if object.respond_to?(:feature)
48
+ # Cucumber < 1.3
49
+ object.feature.file
50
+ else
51
+ # Cucumber >= 1.3
52
+ object.file
53
+ end
43
54
  end
44
55
  end
45
56
  end
@@ -1,3 +1,3 @@
1
1
  module Knapsack
2
- VERSION = '1.7.0'
2
+ VERSION = '1.8.0'
3
3
  end
@@ -100,20 +100,40 @@ describe Knapsack::Adapters::CucumberAdapter do
100
100
 
101
101
  before { stub_const('Cucumber::VERSION', '1') }
102
102
 
103
- context 'when scenario' do
104
- let(:scenario_file) { 'features/scenario.feature' }
105
- let(:scenario_or_outline_table) { double(file: scenario_file) }
103
+ context 'when cucumber >= 1.3' do
104
+ context 'when scenario' do
105
+ let(:scenario_file) { 'features/scenario.feature' }
106
+ let(:scenario_or_outline_table) { double(file: scenario_file) }
106
107
 
107
- it { should eql scenario_file }
108
+ it { should eql scenario_file }
109
+ end
110
+
111
+ context 'when scenario outline' do
112
+ let(:scenario_outline_file) { 'features/scenario_outline.feature' }
113
+ let(:scenario_or_outline_table) do
114
+ double(scenario_outline: double(file: scenario_outline_file))
115
+ end
116
+
117
+ it { should eql scenario_outline_file }
118
+ end
108
119
  end
109
120
 
110
- context 'when scenario outline' do
111
- let(:scenario_outline_file) { 'features/scenario_outline.feature' }
112
- let(:scenario_or_outline_table) do
113
- double(scenario_outline: double(file: scenario_outline_file))
121
+ context 'when cucumber < 1.3' do
122
+ context 'when scenario' do
123
+ let(:scenario_file) { 'features/scenario.feature' }
124
+ let(:scenario_or_outline_table) { double(feature: double(file: scenario_file)) }
125
+
126
+ it { should eql scenario_file }
114
127
  end
115
128
 
116
- it { should eql scenario_outline_file }
129
+ context 'when scenario outline' do
130
+ let(:scenario_outline_file) { 'features/scenario_outline.feature' }
131
+ let(:scenario_or_outline_table) do
132
+ double(scenario_outline: double(feature: double(file: scenario_outline_file)))
133
+ end
134
+
135
+ it { should eql scenario_outline_file }
136
+ end
117
137
  end
118
138
  end
119
139
 
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: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ArturT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-11 00:00:00.000000000 Z
11
+ date: 2016-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -92,14 +92,14 @@ dependencies:
92
92
  requirements:
93
93
  - - ">="
94
94
  - !ruby/object:Gem::Version
95
- version: '1.3'
95
+ version: '0'
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - ">="
101
101
  - !ruby/object:Gem::Version
102
- version: '1.3'
102
+ version: '0'
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: minitest
105
105
  requirement: !ruby/object:Gem::Requirement