Skip to content

Commit

Permalink
+ now uses rig/rspec
Browse files Browse the repository at this point in the history
  • Loading branch information
kschiess committed Jan 2, 2011
1 parent 697e37d commit a26e237
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Gemfile
@@ -1,6 +1,6 @@
source "http://rubygems.org"

gem 'parslet', '~> 1.0'
gem 'parslet', :git => 'git://github.com/kschiess/parslet'

group :development do
gem 'rspec', '~> 2'
Expand Down
11 changes: 8 additions & 3 deletions Gemfile.lock
@@ -1,11 +1,16 @@
GIT
remote: git://github.com/kschiess/parslet
revision: c140a7b5f04cafaf23cad29c6e7c9656777063d1
specs:
parslet (1.1.0)
blankslate (~> 2.1.2.3)

GEM
remote: http://rubygems.org/
specs:
blankslate (2.1.2.3)
diff-lcs (1.1.2)
flexmock (0.8.11)
parslet (1.0.0)
blankslate (~> 2.1.2.3)
rspec (2.3.0)
rspec-core (~> 2.3.0)
rspec-expectations (~> 2.3.0)
Expand All @@ -20,5 +25,5 @@ PLATFORMS

DEPENDENCIES
flexmock
parslet (~> 1.0)
parslet!
rspec (~> 2)
20 changes: 2 additions & 18 deletions spec/wt/parser_spec.rb
@@ -1,26 +1,10 @@
require 'spec_helper'

require 'parslet/rig/rspec'

describe Wt::Parser do
let(:parser) { described_class.new }

RSpec::Matchers.define :parse do |exp|
match do |parser|
begin
parser.parse(exp)
true
rescue Parslet::ParseFailed
false
end
end
failure_message_for_should do |parser|
begin
parser.parse(exp)
rescue Parslet::ParseFailed => b
parser.error_tree.to_s
end
end
end

context "simple arithmetic expressions" do
subject { parser.expression }
it { should parse("1+2") }
Expand Down

0 comments on commit a26e237

Please sign in to comment.