cucumberator 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in cucumberator.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 Vidmantas Kabošis
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ Cucumberator is Cucumber extension to write steps in command line while whatching how browser responds to them:
2
+
3
+ ## Usage
4
+
5
+ * Put @cucumberize tag in front of Scenario you want to append with new steps
6
+ * Fire up the cucumber and wait until prompt shows up
7
+ * Write a step and when happy, type 'save' to get it saved into your .feature file
8
+
9
+ ## Installation
10
+
11
+ If you use bundler (and you should), add 'cucumberator' to your Gemfile. Otherwise, install with
12
+
13
+ gem install cucumberator
14
+
15
+ Then require it in one of your ruby files under features/support (e.g. env.rb)
16
+
17
+ require 'cucumberator'
18
+
19
+ Now put @cucumberize before any Scenario you want to fill up, for example
20
+
21
+ @javascript @cucumberize
22
+ Scenario: check fancy ajax login
23
+ Given user with email some@example.com
24
+
25
+ and then run this feature file and watch your console for prompt shows up.
26
+
27
+ ## What cucumberator DOES NOT DO
28
+
29
+ It doesn't let you define your new step defitions yet.
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "cucumberator/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "cucumberator"
7
+ s.version = Cucumberator::VERSION
8
+ s.authors = ["Vidmantas Kabošis"]
9
+ s.email = ["vidmantas@kabosis.lt"]
10
+ s.homepage = "https://github.com/vidmantas/cucumberator"
11
+ s.summary = "cucumberator-#{s.version}"
12
+ s.description = %q{Prompt for writing Cucumber tests}
13
+ s.post_install_message = "(::)\nCucumberator installed! Now require cucumberator/cucumberize in your env.rb and place @cucumberize before the scenario you'd like to append new steps\n(::)"
14
+
15
+ s.files = `git ls-files`.split("\n")
16
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
+ s.require_paths = ["lib"]
19
+
20
+ s.add_dependency 'cucumber', '~> 1.0.2'
21
+ s.add_dependency 'cucumber-rails', '~> 1.0.2'
22
+ end
@@ -0,0 +1,60 @@
1
+ After('@cucumberize') do |s|
2
+ if s.failed?
3
+ puts "Sorry, no cucumberator when scenario is already failing!"
4
+ return
5
+ end
6
+
7
+ last_input = nil
8
+
9
+ while true
10
+ print "> "
11
+ input = STDIN.gets.chomp
12
+
13
+ begin
14
+ case input
15
+ when "exit"
16
+ break
17
+
18
+ when "exit-all"
19
+ Cucumber.wants_to_quit = true
20
+ break
21
+
22
+ when "help"
23
+ puts %{
24
+ Write a step directly here and watch it happen on the browser
25
+ Available commands:
26
+ save - saves last step into current feature file
27
+ last-step - display last executed step
28
+ exit - exits current step
29
+ exit-all - exists whole Cucumber feature
30
+ help - display this notification
31
+ }
32
+
33
+ when "last-step"
34
+ puts last_input
35
+
36
+ when "save"
37
+ if last_input.blank?
38
+ puts "Hm... nothing to save yet?"
39
+ else
40
+ feature_file = File.join(Rails.root, s.file_colon_line.split(":").first)
41
+ spaces = File.readlines(feature_file)[-1] =~ /\S/
42
+ File.open(feature_file, 'a') do |f|
43
+ f.puts((" " * spaces) + last_input)
44
+ last_input = nil
45
+ end
46
+
47
+ puts "Saved to #{feature_file}"
48
+ end
49
+
50
+ else
51
+ last_input = input
52
+ input = "#{input.split.first} '#{input.split[1..-1].join(' ')}'"
53
+ puts input
54
+ instance_eval input
55
+ end
56
+ rescue Exception => e
57
+ puts e.inspect
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,3 @@
1
+ module Cucumberator
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,2 @@
1
+ require "cucumberator/version"
2
+ require "cucumberator/cucumberize"
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cucumberator
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Vidmantas Kabošis
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-09-14 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: cucumber
16
+ requirement: &18874660 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 1.0.2
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *18874660
25
+ - !ruby/object:Gem::Dependency
26
+ name: cucumber-rails
27
+ requirement: &18868820 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: 1.0.2
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *18868820
36
+ description: Prompt for writing Cucumber tests
37
+ email:
38
+ - vidmantas@kabosis.lt
39
+ executables: []
40
+ extensions: []
41
+ extra_rdoc_files: []
42
+ files:
43
+ - .gitignore
44
+ - Gemfile
45
+ - LICENSE
46
+ - README.md
47
+ - Rakefile
48
+ - cucumberator.gemspec
49
+ - lib/cucumberator.rb
50
+ - lib/cucumberator/cucumberize.rb
51
+ - lib/cucumberator/version.rb
52
+ homepage: https://github.com/vidmantas/cucumberator
53
+ licenses: []
54
+ post_install_message: ! '(::)
55
+
56
+ Cucumberator installed! Now require cucumberator/cucumberize in your env.rb and
57
+ place @cucumberize before the scenario you''d like to append new steps
58
+
59
+ (::)'
60
+ rdoc_options: []
61
+ require_paths:
62
+ - lib
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ none: false
71
+ requirements:
72
+ - - ! '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ requirements: []
76
+ rubyforge_project:
77
+ rubygems_version: 1.8.10
78
+ signing_key:
79
+ specification_version: 3
80
+ summary: cucumberator-0.0.1
81
+ test_files: []