Sha256: e9c7b4d336af3558aa610d9806249d4fe6d4bcda032b67b2a0b836b3dace1bf8

Contents?: true

Size: 710 Bytes

Versions: 9

Compression:

Stored size: 710 Bytes

Contents

require "helper"
require "tmpdir"
require "fileutils"

describe VimGolf::Challenge do

  before :each do
    @dir = Dir.mktmpdir("vimgolf_test_")
    VimGolf::Challenge.path(@dir)
  end

  after :each do
    FileUtils.remove_entry_secure(@dir)
  end

  it "should raise error on invalid challenge" do
    lambda { VimGolf::Challenge.new('invalidID').download }.should raise_error
  end

  it "should return type of challenge on success" do
    challenge = VimGolf::Challenge.new('4d1a1c36567bac34a9000002')
    challenge.download
    challenge.type.should == "rb"
  end

  it "should raise error on invalid upload id" do
    lambda { VimGolf::Challenge.new('invalidID').upload }.should raise_error
  end
end


Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
vimgolf-0.4.8 spec/challenge_spec.rb
vimgolf-0.4.7 spec/challenge_spec.rb
vimgolf-0.4.6 spec/challenge_spec.rb
vimgolf-0.4.5 spec/challenge_spec.rb
vimgolf-0.4.4 spec/challenge_spec.rb
vimgolf-0.4.3 spec/challenge_spec.rb
vimgolf-0.4.2 spec/challenge_spec.rb
vimgolf-0.4.1 spec/challenge_spec.rb
vimgolf-0.4.0 spec/challenge_spec.rb