test/helper.rb in osheet-0.4.0 vs test/helper.rb in osheet-0.5.0
- old
+ new
@@ -3,10 +3,11 @@
require 'test/env'
class Test::Unit::TestCase
class << self
+
def should_be_a_workbook_element(klass)
should_have_instance_methods :workbook, :styles, :templates
context "given a workbook with templates and styles" do
before do
@wkbk = Osheet::Workbook.new {
@@ -53,17 +54,17 @@
should_have_instance_methods :style_class
context "by default" do
before { @default = klass.new }
should "default an empty style class" do
- assert_equal nil, @default.send(:instance_variable_get, "@style_class")
+ assert_equal nil, @default.send(:get_ivar, "style_class")
end
end
should "default an empty style class" do
styled = klass.new{ style_class "awesome thing" }
- assert_equal "awesome thing", styled.send(:instance_variable_get, "@style_class")
+ assert_equal "awesome thing", styled.send(:get_ivar, "style_class")
end
should "verify the style class string" do
['.thing', 'thing.thing', 'thing .thing > thing', 'thin>g'].each do |s|
assert_raises ArgumentError do
@@ -86,10 +87,10 @@
singular = collection.to_s.sub(/s$/, '')
thing = klass.new do
self.send(singular) {}
end
- items = thing.send(:instance_variable_get, "@#{collection}")
+ items = thing.send(:get_ivar, collection)
assert_equal items, thing.send(collection)
assert !items.empty?
assert_equal 1, items.size
assert_kind_of item_klass, items.first
end
\ No newline at end of file