Skip to content

Commit

Permalink
Upgrade to RSpec 2
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Mar 24, 2011
1 parent 57336be commit 752dcba
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Rakefile
Expand Up @@ -16,10 +16,10 @@ file 'lib/regin/tokenizer.rb' => 'lib/regin/tokenizer.rex' do |t|
end


require 'spec/rake/spectask'
require 'rspec/core/rake_task'

Spec::Rake::SpecTask.new(:test) do |t|
t.warning = true
RSpec::Core::RakeTask.new(:test) do |t|
t.ruby_opts = "-w"
end

Rake::Task[:test].enhance [:compile]
4 changes: 2 additions & 2 deletions spec/parsable_spec.rb
@@ -1,6 +1,6 @@
require 'test_helper'

Spec::Matchers.define :be_parsable do
RSpec::Matchers.define :be_parsable do
match do |actual|
expression = Regin.parse(actual)
expression.should be_a(Regin::Expression)
Expand All @@ -11,7 +11,7 @@

InvalidRegexp = Struct.new(:source, :options)

Spec::Matchers.define :not_be_parsable do
RSpec::Matchers.define :not_be_parsable do
match do |actual|
lambda { Regexp.compile(actual) }.should raise_error(RegexpError)
invalid_regexp = InvalidRegexp.new(actual, 0)
Expand Down
4 changes: 2 additions & 2 deletions spec/test_helper.rb
@@ -1,12 +1,12 @@
require 'regin'

Spec::Matchers.define :parse do |expected|
RSpec::Matchers.define :parse do |expected|
match do |actual|
Regin.parse(actual).should == expected
end
end

Spec::Matchers.define :compile do |expected|
RSpec::Matchers.define :compile do |expected|
match do |actual|
Regin.compile(actual).should == expected
end
Expand Down

0 comments on commit 752dcba

Please sign in to comment.