mortadella 0.0.2 → 0.1.0

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: 0c495234b6faf9e2eb68ecdf2591ad4aedab027a
4
- data.tar.gz: 6b6a4cc0a64fdf64d25b8b7ec67ef8fc31bb51cd
3
+ metadata.gz: d262e9420c66f885fce3433ffe7561223bda92af
4
+ data.tar.gz: 07b7dd17e3765b29a143e8885ff791fc21ed5efc
5
5
  SHA512:
6
- metadata.gz: 57d672e67dcc2e90d82364fd5446d368b442f144431f7a7c7a580a7feceebd923fb57b27b6b94f6d81d6ccb397714a829ff85047229fdf6f4813c2ebb9532e0a
7
- data.tar.gz: f72362084e467be2eced35f91cf89b9f1145de8024109e9aa6dbddae83f30fb137174ae9533e2dc1c3e4308ed0c77fa8dafdd927d65bafd6986ab855ca6a0128
6
+ metadata.gz: aab43937cad6d38d7e12ec49eb3c1b0d4e6503f8d510e2bc0503ad6d375f229e4ba54cb836a6af42110dfc2dd0ac209365265ead7574390763108392d0d94de3
7
+ data.tar.gz: 826aabe59c6e123d823202d8078c014fc5d0c1c9015bff60668b811eab8a674624483e6f3ee63c9006f5fc5b8afba53743b17c6bfc9866ec7b852497c1869764
data/.gitignore CHANGED
@@ -1,2 +1 @@
1
1
  /.bundle/
2
- /Gemfile.lock
data/.rubocop.yml ADDED
@@ -0,0 +1,15 @@
1
+ Lint/Eval:
2
+ Enabled: false
3
+
4
+
5
+ Metrics/LineLength:
6
+ Max: 100
7
+
8
+
9
+ Style/EmptyLines:
10
+ Enabled: false
11
+
12
+
13
+ Style/MethodDefParentheses:
14
+ EnforcedStyle: require_no_parentheses
15
+
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.2.1
1
+ 2.2.2
data/Gemfile.lock ADDED
@@ -0,0 +1,62 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ mortadella (0.0.2)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ast (2.0.0)
10
+ astrolabe (1.3.0)
11
+ parser (>= 2.2.0.pre.3, < 3.0)
12
+ builder (3.2.2)
13
+ cucumber (2.0.0)
14
+ builder (>= 2.1.2)
15
+ cucumber-core (~> 1.1.3)
16
+ diff-lcs (>= 1.1.3)
17
+ gherkin (~> 2.12)
18
+ multi_json (>= 1.7.5, < 2.0)
19
+ multi_test (>= 0.1.2)
20
+ cucumber-core (1.1.3)
21
+ gherkin (~> 2.12.0)
22
+ diff-lcs (1.2.5)
23
+ gherkin (2.12.2)
24
+ multi_json (~> 1.3)
25
+ multi_json (1.11.1)
26
+ multi_test (0.1.2)
27
+ parser (2.2.2.5)
28
+ ast (>= 1.1, < 3.0)
29
+ powerpack (0.1.1)
30
+ rainbow (2.0.0)
31
+ rake (10.4.2)
32
+ rspec (3.2.0)
33
+ rspec-core (~> 3.2.0)
34
+ rspec-expectations (~> 3.2.0)
35
+ rspec-mocks (~> 3.2.0)
36
+ rspec-core (3.2.3)
37
+ rspec-support (~> 3.2.0)
38
+ rspec-expectations (3.2.1)
39
+ diff-lcs (>= 1.2.0, < 2.0)
40
+ rspec-support (~> 3.2.0)
41
+ rspec-mocks (3.2.1)
42
+ diff-lcs (>= 1.2.0, < 2.0)
43
+ rspec-support (~> 3.2.0)
44
+ rspec-support (3.2.2)
45
+ rubocop (0.32.0)
46
+ astrolabe (~> 1.3)
47
+ parser (>= 2.2.2.5, < 3.0)
48
+ powerpack (~> 0.1)
49
+ rainbow (>= 1.99.1, < 3.0)
50
+ ruby-progressbar (~> 1.4)
51
+ ruby-progressbar (1.7.5)
52
+
53
+ PLATFORMS
54
+ ruby
55
+
56
+ DEPENDENCIES
57
+ bundler
58
+ cucumber
59
+ mortadella!
60
+ rake
61
+ rspec
62
+ rubocop
data/README.md CHANGED
@@ -10,15 +10,38 @@ through `cucumber_table.diff! mortadella_table`.
10
10
  You want to do this as much as possible.
11
11
  Cucumber has very powerful built-in facilities
12
12
  to visualize where and how two tables differ.
13
- This gives you very readable error messages when your
14
- code behaves differently than what Cucumber expects,
15
- for free.
16
13
 
17
- * [basic usage](https://github.com/Originate/mortadella/blob/master/features/basic_usage.feature)
18
- * you can also [dry up repetitive fields](https://github.com/Originate/mortadella/blob/master/features/drying_up_fields.feature) for better readability
14
+ <img src="http://blog.originate.com/mortadella/ingredients2.png" >
15
+ _Oh no, our algorithm selected too many apples!_
19
16
 
20
17
 
21
18
  ## Installation
22
19
 
23
20
  * add `gem 'mortadella'` to your `Gemfile`
24
21
  * run `bundle`
22
+
23
+
24
+ ## Usage
25
+
26
+ * In your cucumber spec, define the expected data in table form
27
+
28
+ ```cucumber
29
+ Then I have these ingredients
30
+ | INGREDIENT | AMOUNT |
31
+ | flour | 12 oz |
32
+ | butter | 2 oz |
33
+ ```
34
+
35
+ * in the step definition for this, build an equivalent Mortadella table with the actual data,
36
+ and diff the Cucumber table with the expected data against it.
37
+
38
+ ```ruby
39
+ Then /^I have these ingredients$/ do |expected_ingredients|
40
+ actual_ingredients = Mortadella.new headers: ['INGREDIENT', 'AMOUNT']
41
+ actual_ingredients << ['flour', '12 oz'] # This data should come from your app
42
+ actual_ingredients << ['butter', '2 oz'] # This data should come from your app
43
+ expected_ingredients.diff! actual_ingredients.table
44
+ end
45
+ ```
46
+
47
+ * you can also [dry up repetitive fields](https://github.com/Originate/mortadella/blob/master/features/drying_up_fields.feature) for better readability
data/Rakefile CHANGED
@@ -1,2 +1,12 @@
1
- require "bundler/gem_tasks"
1
+ require 'bundler'
2
+ require 'bundler/gem_tasks'
3
+ require 'cucumber'
4
+ require 'cucumber/rake/task'
2
5
 
6
+ Cucumber::Rake::Task.new :features
7
+ task default: %i(lint features)
8
+
9
+ desc 'Run linter'
10
+ task 'lint' do
11
+ sh 'bundle exec rubocop'
12
+ end
data/circle.yml ADDED
@@ -0,0 +1,4 @@
1
+ test:
2
+ override:
3
+ - bundle exec rake
4
+
data/lib/mortadella.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  # Makes it easy to build DRY Cucumber-compatible tables
2
2
  class Mortadella
3
-
4
3
  attr_reader :table
5
4
 
6
5
 
data/mortadella.gemspec CHANGED
@@ -2,23 +2,23 @@
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
- Gem::Specification.new do |spec|
6
- spec.name = "mortadella"
7
- spec.version = "0.0.2"
8
- spec.authors = ["Kevin Goslar"]
9
- spec.email = ["kevin.goslar@gmail.com"]
10
- spec.summary = %q{Mock Ruby Table Delivery}
11
- spec.description = %q{A tool to create Ruby table object to be used for Cucumber comparisons}
12
- spec.homepage = "https://github.com/Originate/mortadella"
13
- spec.license = "MIT"
5
+ Gem::Specification.new do |s|
6
+ s.name = 'mortadella'
7
+ s.version = '0.1.0'
8
+ s.authors = ['Kevin Goslar']
9
+ s.email = ['kevin.goslar@gmail.com']
10
+ s.summary = %s(Mock Ruby Table Delivery)
11
+ s.description = %s(A tool to create Ruby table object to be used for Cucumber comparisons)
12
+ s.homepage = 'https://github.com/Originate/mortadella'
13
+ s.license = 'MIT'
14
14
 
15
- spec.files = `git ls-files -z`.split("\x0")
16
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
- spec.require_paths = ["lib"]
15
+ s.files = `git ls-files -z`.split("\x0")
16
+ s.test_files = Dir['features/*']
17
+ s.require_paths = ['lib']
19
18
 
20
- spec.add_development_dependency "bundler", '~> 1'
21
- spec.add_development_dependency "rake", '~> 10'
22
- spec.add_development_dependency "cucumber", '~> 1'
23
- spec.add_development_dependency "rspec", '~> 3'
19
+ s.add_development_dependency 'bundler'
20
+ s.add_development_dependency 'cucumber'
21
+ s.add_development_dependency 'rake'
22
+ s.add_development_dependency 'rubocop'
23
+ s.add_development_dependency 'rspec'
24
24
  end
metadata CHANGED
@@ -1,71 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mortadella
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Goslar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-27 00:00:00.000000000 Z
11
+ date: 2015-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1'
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: cucumber
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rake
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
- - - "~>"
45
+ - - ">="
32
46
  - !ruby/object:Gem::Version
33
- version: '10'
47
+ version: '0'
34
48
  type: :development
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
- - - "~>"
52
+ - - ">="
39
53
  - !ruby/object:Gem::Version
40
- version: '10'
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
- name: cucumber
56
+ name: rubocop
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - "~>"
59
+ - - ">="
46
60
  - !ruby/object:Gem::Version
47
- version: '1'
61
+ version: '0'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - "~>"
66
+ - - ">="
53
67
  - !ruby/object:Gem::Version
54
- version: '1'
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rspec
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - "~>"
73
+ - - ">="
60
74
  - !ruby/object:Gem::Version
61
- version: '3'
75
+ version: '0'
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - "~>"
80
+ - - ">="
67
81
  - !ruby/object:Gem::Version
68
- version: '3'
82
+ version: '0'
69
83
  description: A tool to create Ruby table object to be used for Cucumber comparisons
70
84
  email:
71
85
  - kevin.goslar@gmail.com
@@ -74,11 +88,14 @@ extensions: []
74
88
  extra_rdoc_files: []
75
89
  files:
76
90
  - ".gitignore"
91
+ - ".rubocop.yml"
77
92
  - ".ruby-version"
78
93
  - Gemfile
94
+ - Gemfile.lock
79
95
  - LICENSE.txt
80
96
  - README.md
81
97
  - Rakefile
98
+ - circle.yml
82
99
  - features/basic_usage.feature
83
100
  - features/drying_up_fields.feature
84
101
  - features/emptiness.feature
@@ -114,5 +131,3 @@ test_files:
114
131
  - features/basic_usage.feature
115
132
  - features/drying_up_fields.feature
116
133
  - features/emptiness.feature
117
- - features/step_definitions/steps.rb
118
- - features/support/env.rb