Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Upgraded to use RSpec 2.0.0

  • Loading branch information...
commit cf668548d9b1ef76baa93044ff0d0bdf8d047532 1 parent 6c4b663
@aslakhellesoy aslakhellesoy authored
View
1  .rspec
@@ -0,0 +1 @@
+--color
View
1  History.txt
@@ -2,6 +2,7 @@
=== New Features
* New synonyms for Hungarian (Bence Golda)
+* Upgraded to use RSpec 2.0.0 (Aslak Hellesøy)
=== Bugfixes
* Include link to explanation of LexingError (Mike Sassak)
View
2  Rakefile
@@ -19,7 +19,7 @@ begin
gem.authors = ["Mike Sassak", "Gregory Hnatiuk", "Aslak Hellesøy"]
gem.executables = ["gherkin"]
gem.add_dependency "trollop", ">= 1.16.2"
- gem.add_development_dependency "rspec", ">= 1.3.0"
+ gem.add_development_dependency 'rspec', '>= 2.0.0.beta.11'
gem.add_development_dependency "cucumber", ">= 0.8.0"
gem.add_development_dependency "rake-compiler", ">= 0.7.0" unless defined?(JRUBY_VERSION)
View
2  spec/gherkin/c_lexer_spec.rb
@@ -1,6 +1,6 @@
#encoding: utf-8
unless defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && RUBY_ENGINE == "ironruby")
-require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+require 'spec_helper'
require 'gherkin_lexer_en'
module Gherkin
View
2  spec/gherkin/csharp_lexer_spec.rb
@@ -1,6 +1,6 @@
#encoding: utf-8
if defined?(RUBY_ENGINE) && RUBY_ENGINE == "ironruby"
-require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+require 'spec_helper'
module Gherkin
module Lexer
View
2  spec/gherkin/formatter/argument_spec.rb
@@ -1,5 +1,5 @@
# encoding: utf-8
-require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
+require 'spec_helper'
require 'gherkin/formatter/argument'
module Gherkin
View
7 spec/gherkin/formatter/colors_spec.rb
@@ -1,11 +1,10 @@
-require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
-require 'gherkin/formatter/pretty_formatter'
-
+require 'spec_helper'
+require 'gherkin/formatter/colors'
module Gherkin
module Formatter
describe Colors do
- include Colors
+ include Gherkin::Formatter::Colors
it "should colour stuff red" do
failed("hello").should == "\e[31mhello\e[0m"
View
2  spec/gherkin/formatter/pretty_formatter_spec.rb
@@ -1,5 +1,5 @@
# encoding: utf-8
-require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
+require 'spec_helper'
require 'gherkin/formatter/pretty_formatter'
require 'gherkin/formatter/argument'
require 'stringio'
View
2  spec/gherkin/i18n_lexer_spec.rb
@@ -1,5 +1,5 @@
#encoding: utf-8
-require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+require 'spec_helper'
module Gherkin
describe I18nLexer do
View
2  spec/gherkin/i18n_spec.rb
@@ -1,5 +1,5 @@
#encoding: utf-8
-require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+require 'spec_helper'
module Gherkin
module Lexer
View
2  spec/gherkin/java_lexer_spec.rb
@@ -1,6 +1,6 @@
#encoding: utf-8
if defined?(JRUBY_VERSION)
-require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+require 'spec_helper'
module Gherkin
module JavaLexer
View
2  spec/gherkin/parser/filter_listener_spec.rb
@@ -1,5 +1,5 @@
# encoding: utf-8
-require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
+require 'spec_helper'
require 'gherkin/parser/filter_listener'
require 'gherkin/formatter/pretty_formatter'
require 'stringio'
View
4 spec/gherkin/parser/parser_spec.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
+require 'spec_helper'
require 'gherkin/parser/parser'
module Gherkin
@@ -33,7 +33,7 @@ module Parser
[true, false].each do |native|
it "should be reusable for several feature files (native lexer: #{native})" do
- listener = mock('listener', :null_object => true)
+ listener = mock('listener').as_null_object
parser = Parser.new(listener, true)
lexer = Gherkin::I18nLexer.new(parser, native)
feature = <<-EOF
View
2  spec/gherkin/parser/tag_expression_spec.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
+require 'spec_helper'
require 'gherkin/parser/tag_expression'
module Gherkin
View
2  spec/gherkin/rb_lexer_spec.rb
@@ -1,5 +1,5 @@
#encoding: utf-8
-require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+require 'spec_helper'
require 'gherkin/rb_lexer/en'
module Gherkin
View
2  spec/gherkin/shared/lexer_spec.rb → spec/gherkin/shared/lexer_group.rb
@@ -1,5 +1,5 @@
#encoding: utf-8
-require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
+require 'spec_helper'
module Gherkin
module Lexer
View
2  spec/gherkin/shared/py_string_spec.rb → spec/gherkin/shared/py_string_group.rb
@@ -1,5 +1,5 @@
# encoding: utf-8
-require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
+require 'spec_helper'
module Gherkin
module Lexer
View
2  spec/gherkin/shared/row_spec.rb → spec/gherkin/shared/row_group.rb
@@ -1,5 +1,5 @@
# encoding: utf-8
-require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
+require 'spec_helper'
module Gherkin
module Lexer
View
2  spec/gherkin/shared/tags_spec.rb → spec/gherkin/shared/tags_group.rb
@@ -1,5 +1,5 @@
# encoding: utf-8
-require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
+require 'spec_helper'
module Gherkin
module Lexer
View
24 spec/spec_helper.rb
@@ -1,16 +1,12 @@
-$LOAD_PATH.unshift(File.dirname(__FILE__))
-$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
-$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'spec/gherkin'))
require 'gherkin'
require 'stringio'
require 'gherkin/sexp_recorder'
require 'rubygems'
-require 'spec'
-require 'spec/autorun'
-require 'shared/lexer_spec'
-require 'shared/tags_spec'
-require 'shared/py_string_spec'
-require 'shared/row_spec'
+require 'gherkin/shared/lexer_group'
+require 'gherkin/shared/tags_group'
+require 'gherkin/shared/py_string_group'
+require 'gherkin/shared/row_group'
+require 'rspec/autorun'
if defined?(JRUBY_VERSION)
class OutputStreamStringIO < Java.java.io.ByteArrayOutputStream
@@ -51,12 +47,12 @@ def rubify_hash(hash)
end
end
-Spec::Runner.configure do |c|
+RSpec.configure do |c|
c.include(GherkinSpecHelper)
end
# Allows comparison of Java List with Ruby Array (rows)
-Spec::Matchers.define :r do |expected|
+RSpec::Matchers.define :r do |expected|
match do |row|
def row.inspect
"r " + self.map{|cell| cell}.inspect
@@ -65,7 +61,7 @@ def row.inspect
end
end
-Spec::Matchers.define :a do |expected|
+RSpec::Matchers.define :a do |expected|
match do |array|
def array.inspect
"a " + self.map{|e| e.to_sym}.inspect
@@ -74,13 +70,13 @@ def array.inspect
end
end
-Spec::Matchers.define :sym do |expected|
+RSpec::Matchers.define :sym do |expected|
match do |actual|
expected.to_s == actual.to_s
end
end
-Spec::Matchers.define :allow do |event|
+RSpec::Matchers.define :allow do |event|
match do |parser|
parser.expected.index(event)
end
View
17 tasks/rspec.rake
@@ -1,15 +1,10 @@
-require 'spec/rake/spectask'
+require 'rspec/core/rake_task'
-Spec::Rake::SpecTask.new(:spec) do |spec|
- spec.libs << 'lib' << 'spec'
- spec.spec_opts << '--color --diff'
-end
+RSpec::Core::RakeTask.new(:spec)
task :spec => [:check_dependencies]
-Spec::Rake::SpecTask.new(:rcov) do |spec|
- spec.libs << 'lib' << 'spec'
- spec.spec_opts << '--color --diff'
- spec.pattern = 'spec/**/*_spec.rb'
- spec.rcov = true
- spec.rcov_opts = %w{--exclude spec\/}
+RSpec::Core::RakeTask.new(:rcov) do |t|
+ t.pattern = 'spec/**/*_spec.rb'
+ t.rcov = true
+ t.rcov_opts = %w{--exclude spec\/}
end
Please sign in to comment.
Something went wrong with that request. Please try again.