I have a variable that comes in from the command line. . .
rspec spec spec/boxing/kata/boxing_kata_spec.rb <spec/fixtures/family_preferences.csv
The variable. . . family_file = $stdin. . .can be seen by the first test that uses it, but not by the second test. . .
it “load data” do
family_file = $stdin
csv_file = Boxing::Kata::LoadFamily.new
highest_err_level, family_data = csv_file.load_validate_family_preferences(family_file)
expect(family_data.length).to be > 0
end
it “member validation” do
family_file = $stdin
csv_file = Boxing::Kata::LoadFamily.new
highest_err_level, family_data = csv_file.load_validate_family_preferences(family_file)
expect(highest_err_level).to eql “None”
end
How can I code this so all tests have access to this variable?
Thanks,
George