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

Rspec 3 #77

Merged
merged 2 commits into from
Jul 14, 2014
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 0 additions & 8 deletions features/rspec_2.99.0_version_test.feature

This file was deleted.

2 changes: 1 addition & 1 deletion lib/methadone/cucumber.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ module Cucumber

Then /^there should be a one line summary of what the app does$/ do
output_lines = all_output.split(/\n/)
output_lines.should have_at_least(3).items
output_lines.size.should >= 3
# [0] is our banner, which we've checked for
output_lines[1].should match(/^\s*$/)
output_lines[2].should match(/^\w+\s+\w+/)
Expand Down
3 changes: 1 addition & 2 deletions methadone.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Gem::Specification.new do |s|
s.add_development_dependency("simplecov", "~> 0.5")
s.add_development_dependency("clean_test")
s.add_development_dependency("mocha", "0.13.2")
s.add_development_dependency("minitest", "4.6.1")
s.add_development_dependency("sdoc")
s.add_development_dependency("rspec", "~> 2.99") # needed so that rspec-bootstrapped app test can run
s.add_development_dependency("rspec", "~> 3.0.0")
end
2 changes: 1 addition & 1 deletion templates/rspec/spec/something_spec.rb.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe "TestSomething" do
it "should be true" do
true.should be_true
true.should == true
end
end
4 changes: 4 additions & 0 deletions test/base_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
SimpleCov.start do
add_filter "/test"
end

require 'test/unit'
require 'rspec/expectations'
require 'clean_test/test_case'
require 'ostruct'

RSpec::Matchers.configuration.syntax = :should

class BaseTest < Clean::Test::TestCase
include RSpec::Matchers
end
10 changes: 5 additions & 5 deletions test/test_sh.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'base_test'
require 'methadone'

class TestSH < Clean::Test::TestCase
class TestSH < BaseTest
include Methadone::SH
include Methadone::CLILogging

Expand Down Expand Up @@ -143,7 +143,7 @@ def fatal(msg); @fatals << msg; end
use_capturing_logger
@command = test_command("foo")
@block_called = false
}
}
When {
@exit_code = sh @command do
@block_called = true
Expand All @@ -160,7 +160,7 @@ def fatal(msg); @fatals << msg; end
use_capturing_logger
@command = test_command("foo")
@block_called = false
}
}
When {
@exit_code = sh @command, :expected => [2] do
@block_called = true
Expand All @@ -180,7 +180,7 @@ def fatal(msg); @fatals << msg; end
@command = test_command("foo")
@block_called = false
@exitstatus_received = nil
}
}
When {
@exit_code = self.send(method,@command,:expected => expected) do |_,_,exitstatus|
@block_called = true
Expand Down Expand Up @@ -242,7 +242,7 @@ def fatal(msg); @fatals << msg; end
}
end

test_that "sh! runs a command that will fail and includes an error message that appears in the exception" do
test_that "sh! runs a command that will fail and includes an error message that appears in the exception" do
Given {
use_capturing_logger
@command = test_command("foo")
Expand Down