spec/queencheck/rspec_spec.rb in queencheck-0.1.2 vs spec/queencheck/rspec_spec.rb in queencheck-1.0.0

- old
+ new

@@ -1,19 +1,19 @@ require 'queencheck/rspec' -describe 'QueenCheck::RSpec' do - qcheck 1, :+, [Integer], {count: 5} do | result, arguments, exception | - result.should == arguments[0] + 1 - end +describe QueenCheck do + QueenCheck('stadard check', String) { | x | + x.class.should == String + } - qcheck 1, :/, [Integer], {count: 5} do | result, arguments, exception | - if exception - if exception.kind_of?(ZeroDivisionError) - arguments[0].should == 0 - else - raise exception - end - else - result.should == 1 / arguments[0] - end + verboseQueenCheck('verbose check', QueenCheck::ASCIIChar) { | x | + x.size.should == 1 + } + + labelingQueenCheck('labelig check', { + "x > y" => proc{|x,y| x > y }, + "x < y" => proc{|x,y| x < y }, + "x = y" => proc{|x,y| x == y }, + },Integer, Integer) do | x, y | + (x + y).should == y + x end end