Skip to content

Commit

Permalink
Moved shared_context blocks to their own file
Browse files Browse the repository at this point in the history
Require shared_context and shared_examples files in helper for easier management
  • Loading branch information
colinc committed Nov 30, 2013
1 parent 2eb2b2a commit 3846c05
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
1 change: 0 additions & 1 deletion spec/desk/client/article_spec.rb
@@ -1,5 +1,4 @@
require 'helper'
require 'shared_examples'

describe Desk::Client do
context "Article" do
Expand Down
1 change: 0 additions & 1 deletion spec/desk/client/macro_spec.rb
@@ -1,5 +1,4 @@
require 'helper'
require 'shared_examples'

describe Desk::Client do
context "Macro" do
Expand Down
4 changes: 4 additions & 0 deletions spec/helper.rb
Expand Up @@ -10,6 +10,10 @@
require 'webmock/rspec'
require 'email_spec'
require 'ruby-debug'

require 'shared_context'
require 'shared_examples'

RSpec.configure do |config|
config.include WebMock::API
end
Expand Down
16 changes: 16 additions & 0 deletions spec/shared_context.rb
@@ -0,0 +1,16 @@
shared_context "basic configuration" do
subject(:client) {
Desk::Client.new(
:subdomain => "example",
:consumer_key => 'CK',
:consumer_secret => 'CS',
:oauth_token => 'OT',
:oauth_token_secret => 'OS'
)
}
end

shared_context "plural endpoint" do
let(:endpoints) { "#{endpoint}s" }
let(:sub_endpoints) { "#{sub_endpoint}s" }
end
17 changes: 1 addition & 16 deletions spec/shared_examples.rb
@@ -1,19 +1,4 @@
shared_context "basic configuration" do
subject(:client) {
Desk::Client.new(
:subdomain => "example",
:consumer_key => 'CK',
:consumer_secret => 'CS',
:oauth_token => 'OT',
:oauth_token_secret => 'OS'
)
}
end

shared_context "plural endpoint" do
let(:endpoints) { "#{endpoint}s" }
let(:sub_endpoints) { "#{sub_endpoint}s" }
end
require 'helper'

shared_examples_for "a list endpoint" do

Expand Down

0 comments on commit 3846c05

Please sign in to comment.