Sha256: 883bc41b6297e888cac087d727b6c57be1a3083c8397a0c0bf5cc4fe017c1b3d

Contents?: true

Size: 533 Bytes

Versions: 14

Compression:

Stored size: 533 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper'
require 'mspec/helpers/argv'

describe Object, "#argv" do
  before :each do
    ScratchPad.clear

    @saved_argv = ARGV
    @argv = ["a", "b"]
  end

  it "replaces and restores the value of ARGV" do
    argv @argv
    ARGV.should == @argv
    argv :restore
    ARGV.should == @saved_argv
  end

  it "yields to the block after setting ARGV" do
    argv @argv do
      ScratchPad.record ARGV
    end
    ScratchPad.recorded.should == @argv
    ARGV.should == @saved_argv
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
mspec-1.5.17 spec/helpers/argv_spec.rb
mspec-1.5.16 spec/helpers/argv_spec.rb
mspec-1.5.15 spec/helpers/argv_spec.rb
mspec-1.5.14 spec/helpers/argv_spec.rb
mspec-1.5.13 spec/helpers/argv_spec.rb
mspec-1.5.12 spec/helpers/argv_spec.rb
mspec-1.5.4 spec/helpers/argv_spec.rb
mspec-1.5.10 spec/helpers/argv_spec.rb
mspec-1.5.11 spec/helpers/argv_spec.rb
mspec-1.5.9 spec/helpers/argv_spec.rb
mspec-1.5.5 spec/helpers/argv_spec.rb
mspec-1.5.6 spec/helpers/argv_spec.rb
mspec-1.5.7 spec/helpers/argv_spec.rb
mspec-1.5.8 spec/helpers/argv_spec.rb