Sha256: b24ca7a63d53cde9f381bf28394a219d874035316205d873c9b587a56114061c

Contents?: true

Size: 769 Bytes

Versions: 9

Compression:

Stored size: 769 Bytes

Contents

require 'spec_helper'
require 'mspec/guards'
require 'mspec/helpers'

describe Object, "#fixture" do
  before :each do
    @dir = File.expand_path(Dir.pwd)
  end

  it "returns the expanded path to a fixture file" do
    name = fixture("some/path/file.rb", "dir", "file.txt")
    name.should == "#{@dir}/some/path/fixtures/dir/file.txt"
  end

  it "omits '/shared' if it is the suffix of the directory string" do
    name = fixture("some/path/shared/file.rb", "dir", "file.txt")
    name.should == "#{@dir}/some/path/fixtures/dir/file.txt"
  end

  it "does not append '/fixtures' if it is the suffix of the directory string" do
    name = fixture("some/path/fixtures/file.rb", "dir", "file.txt")
    name.should == "#{@dir}/some/path/fixtures/dir/file.txt"
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mspec-1.9.1 spec/helpers/fixture_spec.rb
mspec-1.9.0 spec/helpers/fixture_spec.rb
mspec-1.8.0 spec/helpers/fixture_spec.rb
mspec-1.7.0 spec/helpers/fixture_spec.rb
mspec-1.6.0 spec/helpers/fixture_spec.rb
mspec-1.5.21 spec/helpers/fixture_spec.rb
mspec-1.5.20 spec/helpers/fixture_spec.rb
mspec-1.5.19 spec/helpers/fixture_spec.rb
mspec-1.5.18 spec/helpers/fixture_spec.rb