Skip to content

Instantly share code, notes, and snippets.

@rossmeissl
Created March 9, 2011 00:52
Show Gist options
  • Save rossmeissl/861464 to your computer and use it in GitHub Desktop.
Save rossmeissl/861464 to your computer and use it in GitHub Desktop.
Bombshell completion features via cucumber binary
1.9.2p0 vagrant@vagrantup:~/bombshell$ bundle exec cucumber features/completion.feature
Feature: Completion
In order to expedite my exploration
As a user of a Bombshell-enabled Ruby library
I want to be able to use tab completion
Scenario: Single matching command # features/completion.feature:7
Given a file named "fooshell.rb" with: # aruba-0.3.2/lib/aruba/cucumber.rb:66
"""
require 'bombshell'
module Foo
class Shell < Bombshell::Environment
include Bombshell::Shell
def abcdef; end
end
end
Bombshell.launch Foo::Shell
"""
When I run "ruby fooshell.rb" interactively # aruba-0.3.2/lib/aruba/cucumber.rb:102
And I type "abc" and hit tab # features/step_definitions/completion_steps.rb:1
And I type "quit" # aruba-0.3.2/lib/aruba/cucumber.rb:106
Then the output should contain: # aruba-0.3.2/lib/aruba/cucumber.rb:126
"""
abcdef
"""
expected "Switch to inspect mode.\n[Bombshell]> abc\t\nUnknown command abc\n[Bombshell]> quit\n/usr/local/rvm/gems/ruby-1.9.2-p0/gems/bundler-1.0.7/lib/bundler/runtime.rb:132: warning: Insecure world writable dir /vagrant/gems_enabled/bombshell in PATH, mode 040777\n" to include "abcdef"
Diff:
@@ -1,2 +1,6 @@
-abcdef
+Switch to inspect mode.
+[Bombshell]> abc
+Unknown command abc
+[Bombshell]> quit
+/usr/local/rvm/gems/ruby-1.9.2-p0/gems/bundler-1.0.7/lib/bundler/runtime.rb:132: warning: Insecure world writable dir /vagrant/gems_enabled/bombshell in PATH, mode 040777
(RSpec::Expectations::ExpectationNotMetError)
features/completion.feature:22:in `Then the output should contain:'
And the output should not contain: # aruba-0.3.2/lib/aruba/cucumber.rb:130
"""
method_missing
"""
Scenario: Multiple matching commands # features/completion.feature:31
Given a file named "fooshell.rb" with: # aruba-0.3.2/lib/aruba/cucumber.rb:66
"""
require 'bombshell'
module Foo
class Shell < Bombshell::Environment
include Bombshell::Shell
def abcd; end
def abcx; end
end
end
Bombshell.launch Foo::Shell
"""
When I run "ruby fooshell.rb" interactively # aruba-0.3.2/lib/aruba/cucumber.rb:102
And I type "abc" and hit tab twice # features/step_definitions/completion_steps.rb:7
And I type "quit" # aruba-0.3.2/lib/aruba/cucumber.rb:106
Then the output should contain: # aruba-0.3.2/lib/aruba/cucumber.rb:126
"""
abcd
"""
expected "Switch to inspect mode.\n[Bombshell]> abc\t\t\nUnknown command abc\n[Bombshell]> quit\n/usr/local/rvm/gems/ruby-1.9.2-p0/gems/bundler-1.0.7/lib/bundler/runtime.rb:132: warning: Insecure world writable dir /vagrant/gems_enabled/bombshell in PATH, mode 040777\n" to include "abcd"
Diff:
@@ -1,2 +1,6 @@
-abcd
+Switch to inspect mode.
+[Bombshell]> abc
+Unknown command abc
+[Bombshell]> quit
+/usr/local/rvm/gems/ruby-1.9.2-p0/gems/bundler-1.0.7/lib/bundler/runtime.rb:132: warning: Insecure world writable dir /vagrant/gems_enabled/bombshell in PATH, mode 040777
(RSpec::Expectations::ExpectationNotMetError)
features/completion.feature:47:in `Then the output should contain:'
And the output should contain: # aruba-0.3.2/lib/aruba/cucumber.rb:126
"""
abcx
"""
Failing Scenarios:
cucumber features/completion.feature:7 # Scenario: Single matching command
cucumber features/completion.feature:31 # Scenario: Multiple matching commands
2 scenarios (2 failed)
12 steps (2 failed, 2 skipped, 8 passed)
0m22.383s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment