Sha256: 903ea311eff487a4fb267bb6207d9644980607aaa925c1f8c86678f0aa8d00fd
Contents?: true
Size: 900 Bytes
Versions: 2
Compression:
Stored size: 900 Bytes
Contents
require "assert" require "osheet/partial" class Osheet::Partial class UnitTests < Assert::Context desc "Osheet::Partial" before{ @p = Osheet::Partial.new(:thing) {} } subject{ @p } should have_reader :name should "be a Proc" do assert_kind_of ::Proc, subject end should "convert the name arg to a string and store off" do assert_equal 'thing', subject.instance_variable_get("@name") end end class PartialNameTest < Assert::Context desc "A named partial" should "verify the name argument" do assert_raises ArgumentError do Osheet::Partial.new([]) {} end assert_raises ArgumentError do Osheet::Partial.new(1) {} end assert_nothing_raised do Osheet::Partial.new(:poo) {} end assert_nothing_raised do Osheet::Partial.new('poo') {} end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
osheet-1.1.1 | test/unit/partial_tests.rb |
osheet-1.1.0 | test/unit/partial_tests.rb |