-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d42b55d
commit ec0a935
Showing
4 changed files
with
67 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Feature: new_record matcher | ||
|
||
Scenario: new record of correct class | ||
Given a file named "spec/models/widget_spec.rb" with: | ||
""" | ||
require "spec_helper" | ||
describe Widget do | ||
context "when initialized" do | ||
it { should be_a_new(Widget) } | ||
end | ||
end | ||
""" | ||
When I run "rspec spec/models/widget_spec.rb" | ||
Then I should see "1 example, 0 failures" | ||
|
||
Scenario: existing record of correct class | ||
|
||
Scenario: new record of wrong class | ||
Scenario: existing record of wrong class | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Given /a (\w+) model/ do |model_class_name| | ||
puts eval(model_class_name) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
require "aruba" | ||
require "rspec/expectations" | ||
|
||
unless File.directory?('./tmp/example_app') | ||
system "rake generate:app generate:stuff" | ||
end | ||
|
||
def aruba_path(file_or_dir) | ||
File.expand_path("../../../#{file_or_dir.sub('example_app','aruba')}", __FILE__) | ||
end | ||
|
||
def example_app_path(file_or_dir) | ||
File.expand_path("../../../#{file_or_dir}", __FILE__) | ||
end | ||
|
||
def write_symlink(file_or_dir) | ||
source = example_app_path(file_or_dir) | ||
target = aruba_path(file_or_dir) | ||
system "ln -s #{source} #{target}" | ||
end | ||
|
||
Before do | ||
steps %Q{ | ||
Given a directory named "spec" | ||
} | ||
|
||
Dir['tmp/example_app/*'].each do |file_or_dir| | ||
unless file_or_dir =~ /spec$/ | ||
write_symlink(file_or_dir) | ||
end | ||
end | ||
|
||
["spec/spec_helper.rb"].each do |file_or_dir| | ||
write_symlink("tmp/example_app/#{file_or_dir}") | ||
end | ||
|
||
end |