haiti 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f7ac1e4aa58c77fbc3def43967855fe870437e44
4
+ data.tar.gz: 1ce6d56aa93267980ab4c29b6b49e54478ff95eb
5
+ SHA512:
6
+ metadata.gz: 1a6d36ee7cc7be8b00ebc1dfde49a9c20f706e7d3a17349f0fd05cfc37ba77826723937ef84435d6d4d7151f6b55533e70f199ac3bb0446c2e18e4abbd3ed783
7
+ data.tar.gz: 9a9ecb70db5a0fc4c433ed7d6fb37796fd1bdb707071ff2bbe0cb80f145c54c208fe22011e7b8543187fcb6c09ef08956a75de657f192eb2e4279a6ecf9cb676
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ install: env BUNDLE_GEMFILE="$(ruby -e 'print File.expand_path %{test/Gemfile}')" bundle install
3
+ script: env BUNDLE_GEMFILE="$(ruby -e 'print File.expand_path %{test/Gemfile}')" bundle exec cucumber -r test/features/ test/features/
4
+ rvm:
5
+ - 1.9.3
6
+ - 2.0.0
data/Readme.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Build Status](https://api.travis-ci.org/JoshCheek/haiti.svg?branch=master)](https://travis-ci.org/JoshCheek/haiti)
2
+
1
3
  Haiti
2
4
  =====
3
5
 
@@ -1,4 +1,3 @@
1
- require 'haiti/config'
2
1
  require 'haiti/command_line_helpers'
3
2
  require 'haiti/step_definitions'
4
3
 
@@ -1,6 +1,8 @@
1
1
  require 'fileutils'
2
2
  require 'open3'
3
3
 
4
+ require 'haiti/config'
5
+
4
6
  module Haiti
5
7
  module CommandLineHelpers
6
8
  Invocation = Struct.new :stdout, :stderr, :status do
@@ -27,6 +29,10 @@ module Haiti
27
29
  end
28
30
  end
29
31
 
32
+ def read_file(filename)
33
+ in_proving_grounds { File.read filename }
34
+ end
35
+
30
36
  def in_proving_grounds(&block)
31
37
  Dir.chdir config.proving_grounds_dir, &block
32
38
  end
@@ -20,31 +20,49 @@ define_steps.call(
20
20
 
21
21
  define_steps.call(
22
22
  /^(stderr|stdout) is:$/,
23
- /^(stderr|stdout) is "(.*?)"$/,
24
- /^(stderr|stdout) is '(.*?)'$/
25
- ) { |stream_name, output| @last_executed.send(stream_name).chomp.should == eval_curlies(output) }
23
+ /^(stderr|stdout) is "([^"]*?)"$/,
24
+ /^(stderr|stdout) is '([^']*?)'$/
25
+ ) { |stream_name, output| expect(@last_executed.send(stream_name).chomp).to eq eval_curlies(output) }
26
26
 
27
27
  define_steps.call(
28
28
  /^(stderr|stdout) is empty$/
29
- ) { |stream_name| @last_executed.send(stream_name).should == '' }
29
+ ) { |stream_name| expect(@last_executed.send(stream_name)).to eq '' }
30
30
 
31
31
  define_steps.call(
32
32
  /^(stderr|stdout) is not empty$/
33
- ) { |stream_name| @last_executed.send(stream_name).chomp.should_not be_empty }
33
+ ) { |stream_name| expect(@last_executed.send(stream_name).chomp).to_not be_empty }
34
34
 
35
35
  define_steps.call(
36
- /^(stderr|stdout) includes "(.*?)"$/
37
- ) { |stream_name, content| @last_executed.send(stream_name).should include eval_curlies(content) }
36
+ /^(stderr|stdout) includes "([^"]*?)"$/
37
+ ) { |stream_name, content| expect(@last_executed.send(stream_name)).to include eval_curlies(content) }
38
38
 
39
39
  define_steps.call(
40
40
  /^(stderr|stdout) includes:$/
41
- ) { |stream_name, content| @last_executed.send(stream_name).should include eval_curlies(content) }
41
+ ) { |stream_name, content| expect(@last_executed.send(stream_name)).to include eval_curlies(content) }
42
42
 
43
43
  define_steps.call(
44
44
  'the exit status is $status'
45
- ) { |status| @last_executed.exitstatus.to_s.should == status }
45
+ ) { |status| expect(@last_executed.exitstatus.to_s).to eq status }
46
46
 
47
47
  define_steps.call(
48
- /^(stderr|stdout) does not include "(.*?)"$/,
48
+ /^(stderr|stdout) does not include "([^"]*?)"$/,
49
49
  /^(stderr|stdout) does not include:$/
50
- ) { |stream_name, content| @last_executed.send(stream_name).should_not include eval_curlies(content) }
50
+ ) { |stream_name, content| expect(@last_executed.send(stream_name)).to_not include eval_curlies(content) }
51
+
52
+ define_steps.call(
53
+ /^I see the file "([^"]*?)" "([^"]*?)"$/,
54
+ /^I see the file '([^']*?)' '([^']*?)'$/,
55
+ /^I see the file '([^']*?)' "([^"]*?)"$/,
56
+ /^I see the file "([^"]*?)" '([^']*?)'$/,
57
+ /^I see the file '([^']*?)':$/,
58
+ /^I see the file "([^"]*?)":$/
59
+ ) { |filename, body| expect(Haiti::CommandLineHelpers.read_file(filename)).to eq body }
60
+
61
+ define_steps.call(
62
+ /^I see the file "([^"]*?)"$/,
63
+ /^I see the file '([^']*?)'$/
64
+ ) { |filename|
65
+ expect(
66
+ Haiti::CommandLineHelpers.in_proving_grounds { File.exist? filename }
67
+ ).to be_true
68
+ }
@@ -1,3 +1,3 @@
1
1
  module Haiti
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- haiti (0.0.2)
4
+ haiti (0.0.4)
5
5
  cucumber (~> 1.0)
6
6
  rspec (~> 2.0)
7
7
 
@@ -0,0 +1,26 @@
1
+ Feature:
2
+
3
+ Background:
4
+ Given the file "the_file_i_see" "body"
5
+ Scenario: I see the file, single, no body
6
+ Then I see the file 'the_file_i_see'
7
+ Scenario: I see the file, double, no body
8
+ Then I see the file "the_file_i_see"
9
+ Scenario: I see the file with single single
10
+ Then I see the file 'the_file_i_see' 'body'
11
+ Scenario: I see the file with double double
12
+ Then I see the file "the_file_i_see" "body"
13
+ Scenario: I see the file with single double
14
+ Then I see the file 'the_file_i_see' "body"
15
+ Scenario: I see the file with double single
16
+ Then I see the file "the_file_i_see" 'body'
17
+ Scenario: I see the file with single quotes and a "heredoc"
18
+ Then I see the file 'the_file_i_see':
19
+ """
20
+ body
21
+ """
22
+ Scenario: I see the file with double quotes and a "heredoc"
23
+ Then I see the file "the_file_i_see":
24
+ """
25
+ body
26
+ """
metadata CHANGED
@@ -1,48 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haiti
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.0.3
4
+ version: 0.0.4
6
5
  platform: ruby
7
6
  authors:
8
7
  - Josh Cheek
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-06-08 00:00:00.000000000 Z
11
+ date: 2014-03-31 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- version_requirements: !ruby/object:Gem::Requirement
14
+ name: cucumber
15
+ requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.0'
20
- none: false
21
- name: cucumber
22
20
  type: :runtime
23
21
  prerelease: false
24
- requirement: !ruby/object:Gem::Requirement
22
+ version_requirements: !ruby/object:Gem::Requirement
25
23
  requirements:
26
- - - ~>
24
+ - - "~>"
27
25
  - !ruby/object:Gem::Version
28
26
  version: '1.0'
29
- none: false
30
27
  - !ruby/object:Gem::Dependency
31
- version_requirements: !ruby/object:Gem::Requirement
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
32
30
  requirements:
33
- - - ~>
31
+ - - "~>"
34
32
  - !ruby/object:Gem::Version
35
33
  version: '2.0'
36
- none: false
37
- name: rspec
38
34
  type: :runtime
39
35
  prerelease: false
40
- requirement: !ruby/object:Gem::Requirement
36
+ version_requirements: !ruby/object:Gem::Requirement
41
37
  requirements:
42
- - - ~>
38
+ - - "~>"
43
39
  - !ruby/object:Gem::Version
44
40
  version: '2.0'
45
- none: false
46
41
  description: Extraction of cucumber helpers for running binaries that I wind up writing
47
42
  ad-hoc for many projects. It is minimal which lowers the barrier for entry, making
48
43
  it easy to understand/extend.If you need something more powerful, there is Aruba.
@@ -52,7 +47,8 @@ executables: []
52
47
  extensions: []
53
48
  extra_rdoc_files: []
54
49
  files:
55
- - .gitignore
50
+ - ".gitignore"
51
+ - ".travis.yml"
56
52
  - Readme.md
57
53
  - haiti.gemspec
58
54
  - lib/haiti.rb
@@ -69,32 +65,32 @@ files:
69
65
  - test/features/given_the_stdin_content.feature
70
66
  - test/features/support/env.rb
71
67
  - test/features/then_exit_status_is.feature
68
+ - test/features/then_i_see_the_file.feature
72
69
  - test/features/then_stream_is.feature
73
70
  - test/features/when_i_run.feature
74
71
  homepage: https://github.com/JoshCheek/haiti
75
72
  licenses:
76
73
  - WTFPL
74
+ metadata: {}
77
75
  post_install_message:
78
76
  rdoc_options: []
79
77
  require_paths:
80
78
  - lib
81
79
  required_ruby_version: !ruby/object:Gem::Requirement
82
80
  requirements:
83
- - - ! '>='
81
+ - - ">="
84
82
  - !ruby/object:Gem::Version
85
83
  version: '0'
86
- none: false
87
84
  required_rubygems_version: !ruby/object:Gem::Requirement
88
85
  requirements:
89
- - - ! '>='
86
+ - - ">="
90
87
  - !ruby/object:Gem::Version
91
88
  version: '0'
92
- none: false
93
89
  requirements: []
94
90
  rubyforge_project:
95
- rubygems_version: 1.8.23
91
+ rubygems_version: 2.2.2
96
92
  signing_key:
97
- specification_version: 3
93
+ specification_version: 4
98
94
  summary: Simple Cucumber steps for command line programs
99
95
  test_files:
100
96
  - test/Gemfile
@@ -105,6 +101,6 @@ test_files:
105
101
  - test/features/given_the_stdin_content.feature
106
102
  - test/features/support/env.rb
107
103
  - test/features/then_exit_status_is.feature
104
+ - test/features/then_i_see_the_file.feature
108
105
  - test/features/then_stream_is.feature
109
106
  - test/features/when_i_run.feature
110
- has_rdoc: