Skip to content
This repository
Browse code

Move JSON files to spec/support and helperize the files path

  • Loading branch information...
commit 36d08d0f845344841c3dc562c0afa83d31daf6fb 1 parent 830d2ca
Steve Richert laserlemon authored
3  features/support/env.rb
... ... @@ -1,7 +1,8 @@
1 1 $: << File.expand_path("../../../lib", __FILE__)
  2 +
2 3 require "json_spec/cucumber"
3 4
4   -JsonSpec.directory = File.expand_path("../files", __FILE__)
  5 +JsonSpec.directory = File.expand_path("../../../spec/support/files", __FILE__)
5 6
6 7 def last_json
7 8 @last_json.to_s
2  spec/json_spec/helpers_spec.rb
@@ -73,8 +73,6 @@
73 73 end
74 74
75 75 context "load_json_file" do
76   - let(:files_path){ File.expand_path("../../../features/support/files", __FILE__) }
77   -
78 76 it "raises an error when no directory is set" do
79 77 expect{ load_json("one.json") }.to raise_error(JsonSpec::MissingDirectoryError)
80 78 end
2  spec/json_spec/matchers_spec.rb
... ... @@ -1,8 +1,6 @@
1 1 require "spec_helper"
2 2
3 3 describe "Matchers:" do
4   - let(:files_path){ File.expand_path("../../../features/support/files", __FILE__) }
5   -
6 4 context "be_json_eql" do
7 5 it "matches identical JSON" do
8 6 %({"json":"spec"}).should be_json_eql(%({"json":"spec"}))
4 spec/spec_helper.rb
@@ -5,3 +5,7 @@
5 5 JsonSpec.reset
6 6 end
7 7 end
  8 +
  9 +def files_path
  10 + File.expand_path("../support/files", __FILE__)
  11 +end
0  features/support/files/one.json → spec/support/files/one.json
File renamed without changes
0  features/support/files/project/one.json → spec/support/files/project/one.json
File renamed without changes
0  features/support/files/project/two.json → spec/support/files/project/two.json
File renamed without changes
0  features/support/files/project/version/one.json → spec/support/files/project/version/one.json
File renamed without changes
0  features/support/files/project/version/two.json → spec/support/files/project/version/two.json
File renamed without changes
0  features/support/files/two.json → spec/support/files/two.json
File renamed without changes

0 comments on commit 36d08d0

Please sign in to comment.
Something went wrong with that request. Please try again.