Sha256: 75991f6bdcdf0f06077f30253753a2b3e807f96e33bcdd791d99dd9fb54413bc

Contents?: true

Size: 1.07 KB

Versions: 11

Compression:

Stored size: 1.07 KB

Contents

require 'spec/spec_helper'
require 'taza'

describe Taza::Fixture do
  
  it "should be able to load entries from fixtures" do
    Taza::Fixture.any_instance.stubs(:base_path).returns('./spec/sandbox')
    fixture = Taza::Fixture.new
    fixture.load_all
    example = fixture.get_fixture_entity(:examples,'first_example')
    example.name.should eql("first")
    example.price.should eql(1)
  end

  it "should use the spec folder as the base path" do
    Taza::Fixture.new.base_path.should eql('./spec')
  end

  it "should know if a pluralized fixture of that name exists" do
    Taza::Fixture.any_instance.stubs(:base_path).returns('./spec/sandbox')
    fixture = Taza::Fixture.new
    fixture.load_all
    fixture.pluralized_fixture_exists?('example').should be_true
    fixture.pluralized_fixture_exists?('foo').should be_false
  end
  
  it "should be able to get all fixtures loaded" do
    Taza::Fixture.any_instance.stubs(:base_path).returns('./spec/sandbox')
    fixture = Taza::Fixture.new
    fixture.load_all
    fixture.fixture_names.should be_equivalent([:examples,:users])
  end

end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
bret-watircraft-0.4.0 spec/fixture_spec.rb
bret-watircraft-0.4.1 spec/fixture_spec.rb
bret-watircraft-0.4.2 spec/fixture_spec.rb
bret-watircraft-0.4.3 spec/fixture_spec.rb
bret-watircraft-0.4.4 spec/fixture_spec.rb
bret-watircraft-0.4.5 spec/fixture_spec.rb
bret-watircraft-0.5.0 spec/fixture_spec.rb
scudco-taza-0.8.1 spec/fixture_spec.rb
scudco-taza-0.8.3 spec/fixture_spec.rb
taza-0.8.2 spec/fixture_spec.rb
taza-0.8.3 spec/fixture_spec.rb