Sha256: 7cac522a89f807c12834d9dcc9ab5c25dc900e848007801ebe5df170b2c47c7d

Contents?: true

Size: 1.43 KB

Versions: 10

Compression:

Stored size: 1.43 KB

Contents

#
# Copyright (C) 2008-2012 NEC Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#


require "rubygems"
require "rspec"


shared_examples_for "option range" do | option, range |
  context "when #{ option } is within #{ range }" do
    let( option ) { range.first }
    it { expect { subject }.not_to raise_error( ArgumentError ) }
  end


  context "when #{ option } < #{ range.first }" do
    let( option ) { range.first - 1 }
    it { expect { subject }.to raise_error( ArgumentError ) }
  end


  context "when #{ option } > #{ range.last }" do
    let( option ) { range.last + 1 }
    it { expect { subject }.to raise_error( ArgumentError ) }
  end
end


RSpec.configure do | config |
  config.alias_it_should_behave_like_to :it_validates, "it validates"
end


### Local variables:
### mode: Ruby
### coding: utf-8-unix
### indent-tabs-mode: nil
### End:

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
trema-0.3.3 spec/support/action.rb
trema-0.3.2 spec/support/action.rb
trema-0.3.1 spec/support/action.rb
trema-0.3.0 spec/support/action.rb
trema-0.2.8 spec/support/action.rb
trema-0.2.7 spec/support/action.rb
trema-0.2.6 spec/support/action.rb
trema-0.2.5 spec/support/action.rb
trema-0.2.4 spec/support/action.rb
trema-0.2.3 spec/support/action.rb