Skip to content

Commit

Permalink
Add library implementation and specs
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Holzfuß authored and Johannes Holzfuß committed May 5, 2011
1 parent 3f4229e commit 167a457
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
3 changes: 0 additions & 3 deletions lib/Ascii85.rb

This file was deleted.

4 changes: 1 addition & 3 deletions lib/ascii85.rb
Expand Up @@ -9,14 +9,12 @@
# and http://en.wikipedia.org/wiki/Ascii85 for more information about
# the format.
#
# Author:: Johannes Holzfuß (Drangon@gmx.de)
# Author:: Johannes Holzfuß (DataWraith@web.de)
# License:: Distributed under the MIT License (see README.txt)
#


module Ascii85
# The gem version number
VERSION = '1.0.0' # :nodoc:

#
# Encodes the bytes of the given String as Ascii85.
Expand Down
12 changes: 5 additions & 7 deletions spec/ascii85_spec.rb → spec/lib/ascii85_spec.rb
@@ -1,8 +1,6 @@
# encoding: utf-8

require 'spec_helper'

require 'ascii85'
require File.join(File.dirname(__FILE__), '..', 'spec_helper')

describe Ascii85 do

Expand Down Expand Up @@ -110,15 +108,15 @@

describe "#decode" do

it "should decode all specified test-cases correctly", :ruby => 1.9 do
it "should decode all specified test-cases correctly", :ruby => 1.8 do
TEST_CASES.each_pair do |decoded, input|
Ascii85.decode(input).should == decoded.dup.force_encoding('ASCII-8BIT')
Ascii85.decode(input).should == decoded
end
end

it "should decode all specified test-cases correctly", :ruby => 1.8 do
it "should decode all specified test-cases correctly", :ruby => 1.9 do
TEST_CASES.each_pair do |decoded, input|
Ascii85.decode(input).should == decoded
Ascii85.decode(input).should == decoded.dup.force_encoding('ASCII-8BIT')
end
end

Expand Down
5 changes: 1 addition & 4 deletions spec/spec_helper.rb
@@ -1,9 +1,6 @@
# encoding: utf-8

require 'rspec'

# Add lib/ to the path
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
require File.join(File.dirname(__FILE__), '..', 'lib', 'ascii85')

RSpec.configure do |c|
# Filter tests based on ruby version
Expand Down

0 comments on commit 167a457

Please sign in to comment.