Sha256: ab5cdfe6997bccb7a07abfa32d470948ee12211e3cb8ea6dfeb057ce540bd4b4

Contents?: true

Size: 688 Bytes

Versions: 3

Compression:

Stored size: 688 Bytes

Contents

require 'helper'

class IOTest < Test::Unit::TestCase
  context "#initialize" do
    should "set attributes from hash" do
      Joint::IO.new(:name => 'foo').name.should == 'foo'
    end
  end

  should "default content_type to plain text" do
    Joint::IO.new.content_type.should == 'plain/text'
  end

  should "default size to content size" do
    content = 'This is my content'
    Joint::IO.new(:content => content).size.should == content.size
  end

  should "alias path to name" do
    Joint::IO.new(:name => 'foo').path.should == 'foo'
  end

  context "#read" do
    should "return content" do
      Joint::IO.new(:content => 'Testing').read.should == 'Testing'
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
joint-0.5.4 test/joint/test_io.rb
joint-0.5.3 test/joint/test_io.rb
joint-0.5.2 test/joint/test_io.rb