Skip to content

Commit

Permalink
Remove fixtures/common from YAML specs
Browse files Browse the repository at this point in the history
The only line left was `require "yaml"`, use that inline.
  • Loading branch information
herwinw committed Nov 12, 2023
1 parent 6dd4d2e commit 4fdbe00
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 9 deletions.
3 changes: 2 additions & 1 deletion library/yaml/dump_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require_relative '../../spec_helper'
require_relative 'fixtures/common'

require 'yaml'

describe "YAML.dump" do
before :each do
Expand Down
3 changes: 2 additions & 1 deletion library/yaml/dump_stream_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require_relative '../../spec_helper'
require_relative 'fixtures/common'

require 'yaml'

describe "YAML.dump_stream" do
it "returns a YAML stream containing the objects passed" do
Expand Down
1 change: 0 additions & 1 deletion library/yaml/fixtures/common.rb

This file was deleted.

3 changes: 2 additions & 1 deletion library/yaml/load_file_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require_relative '../../spec_helper'
require_relative 'fixtures/common'

require 'yaml'

describe "YAML.load_file" do
before :each do
Expand Down
3 changes: 2 additions & 1 deletion library/yaml/load_stream_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
require_relative '../../spec_helper'
require_relative 'fixtures/common'
require_relative 'fixtures/strings'
require_relative 'shared/each_document'

require 'yaml'

describe "YAML.load_stream" do
it_behaves_like :yaml_each_document, :load_stream
end
3 changes: 2 additions & 1 deletion library/yaml/parse_file_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require_relative '../../spec_helper'
require_relative 'fixtures/common'

require 'yaml'

describe "YAML.parse_file" do
it "returns a YAML::Syck::Map object after parsing a YAML file" do
Expand Down
3 changes: 2 additions & 1 deletion library/yaml/parse_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require_relative '../../spec_helper'
require_relative 'fixtures/common'

require 'yaml'

describe "YAML.parse with an empty string" do
it "returns false" do
Expand Down
3 changes: 2 additions & 1 deletion library/yaml/shared/load.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require_relative '../fixtures/common'
require_relative '../fixtures/strings'

require 'yaml'

describe :yaml_load_safe, shared: true do
it "returns a document from current io stream when io provided" do
@test_file = tmp("yaml_test_file")
Expand Down
3 changes: 2 additions & 1 deletion library/yaml/to_yaml_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
require_relative '../../spec_helper'
require_relative 'fixtures/common'
require_relative 'fixtures/example_class'

require 'yaml'

describe "Object#to_yaml" do

it "returns the YAML representation of an Array object" do
Expand Down

0 comments on commit 4fdbe00

Please sign in to comment.