Sha256: b0f2b4eb8c391bc20719b23da82c427d9b9c130447b2365eedbccd038299f57b

Contents?: true

Size: 672 Bytes

Versions: 6

Compression:

Stored size: 672 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 type to plain text" do
    Joint::IO.new.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

6 entries across 6 versions & 2 rubygems

Version Path
joint-0.6.2 test/joint/test_io.rb
joint-0.6.1 test/joint/test_io.rb
jamieorc-joint-0.6.1 test/joint/test_io.rb
jamieorc-joint-0.5.6 test/joint/test_io.rb
joint-0.6.0 test/joint/test_io.rb
joint-0.5.5 test/joint/test_io.rb