mortadella 0.0.1 → 0.0.2

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: f0680e858918ad2037afeda8c7bc6f2093dee7d7
4
- data.tar.gz: bd4407c36e775e05e21bf916d89e5b68fc0332d8
3
+ metadata.gz: 0c495234b6faf9e2eb68ecdf2591ad4aedab027a
4
+ data.tar.gz: 6b6a4cc0a64fdf64d25b8b7ec67ef8fc31bb51cd
5
5
  SHA512:
6
- metadata.gz: ff4ad205a289f8c6f2d223c686e69c3e3adf695b62ac0fbbdad3fb2866e6587b304e272f89dc3137183c533a5c7066821333f6645182b1d9a96a2e5f4133144a
7
- data.tar.gz: 8bcc8976387cca926aee3ecfe5f69bc135941c037e504fd64b3d6770784d59116bc359bb8dfaf1ff7d6dcb0295d7e1a9f03b209d4e4aef5846fbd70bba36b618
6
+ metadata.gz: 57d672e67dcc2e90d82364fd5446d368b442f144431f7a7c7a580a7feceebd923fb57b27b6b94f6d81d6ccb397714a829ff85047229fdf6f4813c2ebb9532e0a
7
+ data.tar.gz: f72362084e467be2eced35f91cf89b9f1145de8024109e9aa6dbddae83f30fb137174ae9533e2dc1c3e4308ed0c77fa8dafdd927d65bafd6986ab855ca6a0128
@@ -6,11 +6,11 @@ Feature: Creating mock data tables
6
6
 
7
7
 
8
8
  Scenario: Creating a simple data table
9
- Given I create a Mortadella instance: "m = Mortadella.new headers: ['DAY', 'ACTIVITY']"
10
- And I add a data row: "m << ['Monday', 'mowing']"
11
- And I add another data row: "m << ['Tuesday', 'tutoring']"
12
- And I add another data row: "m << ['Wednesday', 'welcoming']"
13
- When I request the data table from my Mortadella instance "m.table"
9
+ Given I create a Mortadella instance: "m = Mortadella.new headers: ['DAY', 'ACTIVITY']"
10
+ And I add a data row: "m << ['Monday', 'mowing']"
11
+ And I add another data row: "m << ['Tuesday', 'tutoring']"
12
+ And I add another data row: "m << ['Wednesday', 'welcoming']"
13
+ When I request the instance data table "m.table"
14
14
  Then I receive an object that matches this Cucumber table
15
15
  | DAY | ACTIVITY |
16
16
  | Monday | mowing |
@@ -6,17 +6,17 @@ Feature: Drying up repetitive fields
6
6
 
7
7
 
8
8
  Scenario: drying up repetitive columns
9
- Given I create a Mortadella instance with a DRY column: "m = Mortadella.new headers: ['DAY', 'ACTIVITY'], dry: ['DAY']"
9
+ Given I have a Mortadella instance with a DRY column: "m = Mortadella.new headers: ['DAY', 'ACTIVITY'], dry: ['DAY']"
10
10
 
11
- And I add an activity for Monday: "m << ['Monday', 'mowing']"
12
- And I add another activity for Monday: "m << ['Monday', 'musing']"
13
- And I add another activity for Monday: "m << ['Monday', 'mentoring']"
11
+ And I add an activity for Monday: "m << ['Monday', 'mowing']"
12
+ And I add another activity for Monday: "m << ['Monday', 'musing']"
13
+ And I add another activity for Monday: "m << ['Monday', 'mentoring']"
14
14
 
15
- And I add an activity for Tuesday: "m << ['Tuesday', 'typing']"
16
- And I add another activity for Tuesday: "m << ['Tuesday', 'tutoring']"
17
- And I add another activity for Tuesday: "m << ['Tuesday', 'throwing']"
15
+ And I add an activity for Tuesday: "m << ['Tuesday', 'typing']"
16
+ And I add another activity for Tuesday: "m << ['Tuesday', 'tutoring']"
17
+ And I add another activity for Tuesday: "m << ['Tuesday', 'throwing']"
18
18
 
19
- When I request the data table from the Mortadella instance "m.table"
19
+ When I request the instance data table "m.table"
20
20
  Then I receive a table with repeated day names cleared out for better readability
21
21
  | DAY | ACTIVITY |
22
22
  | Monday | mowing |
@@ -0,0 +1,18 @@
1
+ Feature: Verifying emptiness
2
+
3
+ As a Cucumber user
4
+ I want a programmatic way to verify emptiness of a Mortadella instance
5
+ So that I can verify the absence of data in comfortable ways.
6
+
7
+
8
+ Scenario: an empty table
9
+ Given I have a Mortadella instance: "m = Mortadella.new headers: ['foo']"
10
+ When I ask it whether it is empty: "m.empty?"
11
+ Then it responds with true
12
+
13
+
14
+ Scenario: a non-empty table
15
+ Given I have a Mortadella instance: "m = Mortadella.new headers: ['foo']"
16
+ And I add a data row: "m << ['bar']"
17
+ When I ask it whether it is empty: "m.empty?"
18
+ Then it responds with false
@@ -1,9 +1,15 @@
1
- Given(/^I (?:add|create|request) .+? "(.+?)"$/) do |code|
1
+ Given(/^I (?:add|ask|create|have|request) .+? "(.+?)"$/) do |code|
2
2
  @result = eval "@#{code}"
3
3
  end
4
4
 
5
5
 
6
+
7
+
6
8
  Then(/^I receive/) do |table|
7
9
  table.diff! @result
8
10
  end
9
11
 
12
+
13
+ Then(/^it responds with (.+?)$/) do |code|
14
+ @result = eval "@#{code}"
15
+ end
data/lib/mortadella.rb CHANGED
@@ -42,4 +42,8 @@ class Mortadella
42
42
  result
43
43
  end
44
44
 
45
+
46
+ def empty?
47
+ @table.size == 1
48
+ end
45
49
  end
data/mortadella.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "mortadella"
7
- spec.version = "0.0.1"
7
+ spec.version = "0.0.2"
8
8
  spec.authors = ["Kevin Goslar"]
9
9
  spec.email = ["kevin.goslar@gmail.com"]
10
10
  spec.summary = %q{Mock Ruby Table Delivery}
@@ -17,8 +17,8 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_development_dependency "bundler", '~> 0'
21
- spec.add_development_dependency "rake", '~> 0'
22
- spec.add_development_dependency "cucumber", '~> 0'
23
- spec.add_development_dependency "rspec", '~> 0'
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'
24
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mortadella
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
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-26 00:00:00.000000000 Z
11
+ date: 2015-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '1'
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: '0'
26
+ version: '1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '10'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '10'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: cucumber
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '1'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '1'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '3'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '3'
69
69
  description: A tool to create Ruby table object to be used for Cucumber comparisons
70
70
  email:
71
71
  - kevin.goslar@gmail.com
@@ -81,6 +81,7 @@ files:
81
81
  - Rakefile
82
82
  - features/basic_usage.feature
83
83
  - features/drying_up_fields.feature
84
+ - features/emptiness.feature
84
85
  - features/step_definitions/steps.rb
85
86
  - features/support/env.rb
86
87
  - lib/mortadella.rb
@@ -112,5 +113,6 @@ summary: Mock Ruby Table Delivery
112
113
  test_files:
113
114
  - features/basic_usage.feature
114
115
  - features/drying_up_fields.feature
116
+ - features/emptiness.feature
115
117
  - features/step_definitions/steps.rb
116
118
  - features/support/env.rb