spec/antelope/ace/compiler_spec.rb in antelope-0.1.1 vs spec/antelope/ace/compiler_spec.rb in antelope-0.1.2
- old
+ new
@@ -3,11 +3,11 @@
<<-DOC
%{
test
%}
- %require "0.0.1"
+ %require "#{VERSION}"
%type "ruby"
%terminal NUMBER
%terminal SEMICOLON ";"
%terminal ADD "+"
@@ -44,7 +44,17 @@
its(:options) { should have_key :type }
it "should have the proper terminals" do
expect(subject.options[:terminals].map(&:first)).to eq [:NUMBER,
:SEMICOLON, :ADD, :LPAREN, :RPAREN]
+ end
+
+ context "with an unmatched version" do
+ let :file do "%require \"0.0.0\"\n%%\n%%\n" end
+
+ it "should raise an error" do
+ expect {
+ subject
+ }.to raise_error(Ace::IncompatibleVersionError)
+ end
end
end