Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 0.14 - dependencies and build failure fixes #516

Merged
merged 16 commits into from
Nov 24, 2017
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rvm:
- 2.1.8
- 2.2.4
- 2.3.0
- jruby
- jruby-1.7.26
- jruby-20mode
- jruby-21mode
- rbx
Expand All @@ -30,6 +30,10 @@ matrix:
env: JRUBY_OPTS='--dev'
- rvm: jruby-9.0.1.0-21mode
env: JRUBY_OPTS='--dev'
branches:
only:
- master
- still
notifications:
email:
- cukes-devs@googlegroups.com
Expand Down
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ group :development, :test do
gem 'cucumber', '~> 2.0'
end

if RUBY_VERSION < '1.9.2'
gem 'contracts', '~> 0.15.0'
else
gem 'contracts', '~> 0.16.0'
end

if RUBY_VERSION >= '1.9.3'
# Make aruba compliant to ruby community guide
gem 'rubocop', '~> 0.32', '< 0.41.1'
Expand Down
5 changes: 2 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ require 'cucumber/rake/task'

Cucumber::Rake::Task.new do |t|
t.cucumber_opts = ""
# t.cucumber_opts = "--format Cucumber::Pro --out cucumber-pro.log" if ENV['CUCUMBER_PRO_TOKEN']
t.cucumber_opts << "--format pretty"
t.cucumber_opts << "--format progress"
end

Cucumber::Rake::Task.new(:cucumber_wip) do |t|
Expand All @@ -19,7 +18,7 @@ end
require 'rspec/core/rake_task'
desc "Run RSpec"
RSpec::Core::RakeTask.new do |spec|
spec.rspec_opts = ['--color', '--format documentation', '--warnings']
spec.rspec_opts = ['--color', '--format progress', '--warnings']
end

namespace :travis do
Expand Down
2 changes: 1 addition & 1 deletion aruba.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gem::Specification.new do |s|
s.homepage = 'http://github.com/cucumber/aruba'

s.add_runtime_dependency 'cucumber', '>= 1.3.19'
s.add_runtime_dependency 'childprocess', '~> 0.5.6'
s.add_runtime_dependency 'childprocess', '~> 0.8.0'
s.add_runtime_dependency 'ffi', '~> 1.9.10'
s.add_runtime_dependency 'rspec-expectations', '>= 2.99'
s.add_runtime_dependency 'contracts', '~> 0.9'
Expand Down
24 changes: 0 additions & 24 deletions features/development/test.feature

This file was deleted.

10 changes: 10 additions & 0 deletions features/getting_started/run_commands.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Feature: Run commands with Aruba
\"\"\"
"""

@requires-bash
Scenario: Bash Program
Given an executable named "bin/cli" with:
"""bash
Expand All @@ -33,6 +34,7 @@ Feature: Run commands with Aruba
When I successfully run `cucumber`
Then the features should all pass

@requires-bash
Scenario: Bash Program run via bash
Given a file named "features/hello_aruba.feature" with:
"""
Expand All @@ -51,6 +53,7 @@ Feature: Run commands with Aruba
When I successfully run `cucumber`
Then the features should all pass

@requires-ruby
Scenario: Ruby Program
Given an executable named "bin/cli" with:
"""ruby
Expand All @@ -61,6 +64,7 @@ Feature: Run commands with Aruba
When I successfully run `cucumber`
Then the features should all pass

@requires-ruby
Scenario: Ruby Program via "ruby"
Given a file named "features/hello_aruba.feature" with:
"""
Expand All @@ -79,6 +83,7 @@ Feature: Run commands with Aruba
When I successfully run `cucumber`
Then the features should all pass

@requires-python
Scenario: Python Program
Given an executable named "bin/cli" with:
"""python
Expand All @@ -89,6 +94,7 @@ Feature: Run commands with Aruba
When I successfully run `cucumber`
Then the features should all pass

@requires-python
Scenario: Python Program via "python"
Given a file named "features/hello_aruba.feature" with:
"""
Expand All @@ -107,6 +113,7 @@ Feature: Run commands with Aruba
When I successfully run `cucumber`
Then the features should all pass

@requires-perl
Scenario: Perl Program
Given an executable named "bin/cli" with:
"""perl
Expand All @@ -117,6 +124,7 @@ Feature: Run commands with Aruba
When I successfully run `cucumber`
Then the features should all pass

@requires-perl
Scenario: Perl Program via "perl"
Given a file named "features/hello_aruba.feature" with:
"""
Expand All @@ -135,6 +143,7 @@ Feature: Run commands with Aruba
When I successfully run `cucumber`
Then the features should all pass

@requires-java
Scenario: Java Program

It's even possible to compile and run Java programs with Aruba.
Expand Down Expand Up @@ -162,6 +171,7 @@ Feature: Run commands with Aruba
When I successfully run `cucumber`
Then the features should all pass

@requires-posix-standard-tools
Scenario: POSIX standard tools
Given a file named "features/hello_aruba.feature" with:
"""
Expand Down
2 changes: 2 additions & 0 deletions features/hooks/after/command.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Feature: After command hooks
Scenario: Run a simple command with an "after(:command)"-hook
Given a file named "spec/support/hooks.rb" with:
"""
require 'aruba'

Aruba.configure do |config|
config.after :command do |cmd|
puts "after the run of `#{cmd.commandline}`"
Expand Down
4 changes: 4 additions & 0 deletions features/hooks/before/command.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Feature: before_cmd hooks
Scenario: Run a simple command with a "before(:command)"-hook
Given a file named "spec/support/hooks.rb" with:
"""
require 'aruba'

Aruba.configure do |config|
config.before :command do |cmd|
puts "before the run of `#{cmd.commandline}`"
Expand All @@ -47,6 +49,8 @@ Feature: before_cmd hooks
Scenario: Run a simple command with a "before(:cmd)"-hook (deprecated)
Given a file named "spec/support/hooks.rb" with:
"""
require 'aruba'

Aruba.configure do |config|
config.before :cmd do |cmd|
puts "before the run of `#{cmd}`"
Expand Down
60 changes: 60 additions & 0 deletions features/step_definitions/hooks.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,65 @@
require 'cucumber/platform'

Before '@requires-python' do |scenario|
next unless Aruba.platform.which('python').nil?

if Cucumber::VERSION < '2'
scenario.skip_invoke!
else
skip_this_scenario
end
end

Before '@requires-zsh' do |scenario|
next unless Aruba.platform.which('zsh').nil?

if Cucumber::VERSION < '2'
scenario.skip_invoke!
else
skip_this_scenario
end
end

Before '@requires-java' do |scenario|
next unless Aruba.platform.which('javac').nil?

if Cucumber::VERSION < '2'
scenario.skip_invoke!
else
skip_this_scenario
end
end

Before '@requires-perl' do |scenario|
next unless Aruba.platform.which('perl').nil?

if Cucumber::VERSION < '2'
scenario.skip_invoke!
else
skip_this_scenario
end
end

Before '@requires-ruby' do |scenario|
next unless Aruba.platform.which('ruby').nil?

if Cucumber::VERSION < '2'
scenario.skip_invoke!
else
skip_this_scenario
end
end

Before '@requires-posix-standard-tools' do |scenario|
next unless Aruba.platform.which('printf').nil?

if Cucumber::VERSION < '2'
scenario.skip_invoke!
else
skip_this_scenario
end
end

Before '@requires-ruby-version-193' do |scenario|
next if RUBY_VERSION >= '1.9.3'

Expand Down
25 changes: 2 additions & 23 deletions features/steps/command/output.feature
Original file line number Diff line number Diff line change
Expand Up @@ -81,33 +81,12 @@ Feature: All output of commands which were executed
When I run `cucumber`
Then the features should all pass

@posix
Scenario: Detect exact one-line output for posix commands
Scenario: Detect exact one-line output
Given a file named "features/output.feature" with:
"""cucumber
Feature: Run command
Scenario: Run command
When I run `printf 'hello world'`
Then the output should contain exactly:
\"\"\"
hello world
\"\"\"
"""
When I run `cucumber`
Then the features should all pass

Scenario: Detect exact one-line output for ruby commands
Given an executable named "bin/cli" with:
"""ruby
#!/usr/bin/env ruby

print "hello world"
"""
And a file named "features/output.feature" with:
"""cucumber
Feature: Run command
Scenario: Run command
When I run `cli`
When I run `echo 'hello world'`
Then the output should contain exactly:
\"\"\"
hello world
Expand Down
4 changes: 2 additions & 2 deletions features/steps/command/shell.feature
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Feature: Running shell commands

puts "Hello"
\"\"\"
Then the output should contain exactly "Hello"
Then the output should contain "Hello"

Scenario: Running python script
When I run the following script:
Expand Down Expand Up @@ -89,7 +89,7 @@ Feature: Running shell commands
\"\"\"ruby
puts "Hello, Aruba!"
\"\"\"
Then the output should contain exactly "Hello, Aruba!"
Then the output should contain "Hello, Aruba!"
"""
When I run `cucumber`
Then the features should all pass
Expand Down
37 changes: 1 addition & 36 deletions features/steps/overview.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,10 @@ Feature: Overview of steps
Who would like to use `aruba`
But didn't know which steps are available

Background:
Scenario: Use cucumber output formatter
Given I use a fixture named "cli-app"

Scenario: Use information found in repository
Given an executable named "bin/cli" with:
"""
#!/bin/bash
git clone https://github.com/cucumber/aruba.git
cd aruba
grep -E "When|Given|Then" lib/aruba/cucumber/*.rb | awk -F ":" '{ $1 = ""; print $0}' |sort
"""
And a file named "features/run.feature" with:
"""
Feature: Run it
Scenario: Run command
When I run `cli`
Then the output should contain:
\"\"\"
Cloning into 'aruba'...
\"\"\"
And the output should contain:
\"\"\"
Given(/^
\"\"\"
And the output should contain:
\"\"\"
When(/^
\"\"\"
And the output should contain:
\"\"\"
Then(/^
\"\"\"
"""
When I run `cucumber`
Then the features should all pass

Scenario: Use cucumber output formatter
Given a file named "features/run.feature" with:
"""
Feature: Run it
Scenario: Run command
Given a directory named "features"
Expand Down
1 change: 1 addition & 0 deletions lib/aruba/api/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ def run_simple(*args)
expect(command).to be_successfully_executed
rescue RSpec::Expectations::ExpectationNotMetError => e
aruba.announcer.activate(aruba.config.activate_announcer_on_command_failure)
aruba.event_bus.notify Events::CommandStopped.new(command)
raise e
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/aruba/cucumber/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
end

Then(/^the output should be (\d+) bytes long$/) do |size|
expect(last_command_started.output).to be_size size.to_i
expect(last_command_started.output).to have_output_size size.to_i
end

Then(/^(?:the )?(output|stderr|stdout)(?: from "([^"]*)")? should( not)? contain( exactly)? "([^"]*)"$/) do |channel, cmd, negated, exactly, expected|
Expand Down
Loading