experience 0.0.0 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,8 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0" is_locked="false">
3
+ <option name="myName" value="Project Default" />
4
+ <option name="myLocal" value="false" />
5
+ <inspection_tool class="RubyDefParenthesesInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
6
+ <inspection_tool class="RubyQuotedStringsInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
7
+ </profile>
8
+ </component>
@@ -0,0 +1,7 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <settings>
3
+ <option name="PROJECT_PROFILE" value="Project Default" />
4
+ <option name="USE_PROJECT_PROFILE" value="true" />
5
+ <version value="1.0" />
6
+ </settings>
7
+ </component>
@@ -0,0 +1,24 @@
1
+ <component name="ProjectRunConfigurationManager">
2
+ <configuration default="false" name="test: experience" type="RakeRunConfigurationType" factoryName="Rake">
3
+ <module name="experience" />
4
+ <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
5
+ <RAKE_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
6
+ <RAKE_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
7
+ <RAKE_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
8
+ <RAKE_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
9
+ <envs />
10
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="true" />
11
+ <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
12
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov" />
13
+ <EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
14
+ <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_NAME" VALUE="test" />
15
+ <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_ARGS" VALUE="" />
16
+ <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_ATTACHED_TEST_FRAMEWORKS" VALUE=":test_unit " />
17
+ <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_TRACE" VALUE="false" />
18
+ <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_DRYRUN" VALUE="false" />
19
+ <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_PREREQS" VALUE="false" />
20
+ <RunnerSettings RunnerId="RubyRunner" />
21
+ <ConfigurationWrapper RunnerId="RubyRunner" />
22
+ <method />
23
+ </configuration>
24
+ </component>
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
5
+ - 2.1.2
6
+ - jruby-19mode
7
+ script: rake acceptance
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem 'rake'
4
+
5
+ gemspec
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  experience
2
2
  ==========
3
+ [![Build Status](https://travis-ci.org/daneandersen/experience.png)](https://travis-ci.org/daneandersen/experience)
3
4
 
4
5
  Test applications for the user experience
@@ -0,0 +1,32 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ require 'rake'
4
+ require 'rspec/core/rake_task'
5
+ require 'cucumber'
6
+ require 'cucumber/rake/task'
7
+ require 'experience'
8
+ require_relative 'features/support/stub_platform'
9
+ require_relative 'lib/experience/features'
10
+
11
+ Bundler::GemHelper.install_tasks
12
+
13
+ RSpec::Core::RakeTask.new(:spec) do |spec|
14
+ spec.ruby_opts = "-I lib:spec"
15
+ spec.pattern = 'spec/**/*_spec.rb'
16
+ end
17
+ task :spec
18
+
19
+
20
+ Cucumber::Rake::Task.new(:acceptance, "Run features") do |t|
21
+ t.profile = 'acceptance'
22
+ t.cucumber_opts = "--color #{features_directory}"
23
+ end
24
+
25
+ desc 'Run all specs and cukes'
26
+ task :test => ['spec', 'features']
27
+
28
+ task :lib do
29
+ $LOAD_PATH.unshift(File.expand_path("lib", File.dirname(__FILE__)))
30
+ end
31
+
32
+ task :default => :test
@@ -0,0 +1 @@
1
+ acceptance: --color
@@ -1,21 +1,28 @@
1
- Gem::Specification.new do |s|
2
- s.name = 'experience'
3
- s.version = '0.0.0'
4
- s.platform = Gem::Platform::RUBY
5
- s.date = '2014-09-12'
6
- s.summary = "Test the user experience"
7
- s.description = "Test applications for the user experience. "\
8
- "This is an implementation of the User Interaction testing pattern."
9
- s.authors = ["Dane Andersen"]
10
- s.email = ['dane.andersen@gmail.com']
11
- s.files = ["lib/hola.rb"]
12
- s.homepage = "https://github.com/daneandersen/experience"
13
- s.license = 'MIT'
1
+ # coding: utf-8
2
+ features = File.expand_path('../features', __FILE__)
3
+ $LOAD_PATH.unshift(features) unless $LOAD_PATH.include?(features)
4
+ lib = File.expand_path('../lib', __FILE__)
5
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
+ require 'experience/version'
14
7
 
15
- s.rubyforge_project = "experience"
8
+ Gem::Specification.new do |spec|
9
+ spec.name = "experience"
10
+ spec.version = Experience::VERSION
11
+ spec.authors = ["Dane Andersen"]
12
+ spec.email = ["dane.andersen@gmail.com"]
13
+ spec.summary = %q{Test the user experience}
14
+ spec.description = %q{Test applications for the user experience.
15
+ This is an implementation of the User Interaction testing pattern.}
16
+ spec.homepage = "https://github.com/daneandersen/experience"
17
+ spec.license = "MIT"
16
18
 
17
- s.files = `git ls-files`.split("\n")
18
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
- s.require_paths = ["lib"]
21
- end
19
+ spec.rubyforge_project = "experience"
20
+
21
+ spec.files = `git ls-files -z`.split("\x0")
22
+ spec.test_files = spec.files.grep(%r{^(spec|features)/})
23
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
24
+ spec.require_paths = ["lib","features"]
25
+
26
+ spec.add_development_dependency "rspec", "~> 3.0"
27
+ spec.add_development_dependency "cucumber", "~> 1.3"
28
+ end
@@ -0,0 +1,10 @@
1
+ Feature: Read content of the application
2
+ As a User of the Application Under Test
3
+ I want to read content
4
+ In order to know what the application is trying to tell me
5
+
6
+ @wip
7
+ Scenario: Single piece of content
8
+ Given there is content in the application
9
+ When I read the content
10
+ Then I will know what it says
@@ -0,0 +1,16 @@
1
+ Given(/^there is content in the application$/) do
2
+ class Tutorial
3
+ extend Experience
4
+ content(:headline, :id => 'headline')
5
+ end
6
+ end
7
+
8
+ When(/^I read the content$/) do
9
+ Tutorial.read do |tutorial|
10
+ @content = tutorial.headline
11
+ end
12
+ end
13
+
14
+ Then(/^I will know what it says$/) do
15
+ expect(@content).to eq '"Experience" Models User Interactions'
16
+ end
@@ -0,0 +1,4 @@
1
+ require_relative 'stub_platform'
2
+ require 'experience'
3
+
4
+ DefaultPlatform.register Experience::Stub::Platform
@@ -0,0 +1,3 @@
1
+ :content:
2
+ :id:
3
+ headline: '"Experience" Models User Interactions'
@@ -0,0 +1,14 @@
1
+ module Experience
2
+ module Stub
3
+ class Platform
4
+
5
+ def self.information
6
+ @information ||= YAML.load_file File.expand_path('../stub_data.yml', __FILE__,)
7
+ end
8
+
9
+ def self.get_content identifier
10
+ information.fetch(:content).fetch(identifier.keys.first).fetch(identifier.values.first)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -1,3 +1,27 @@
1
1
  module Experience
2
- #nothing to it but to do it
2
+ def content name, locator
3
+ define_singleton_method name do
4
+ platform.get_content(locator)
5
+ end
6
+ end
7
+
8
+ def read
9
+ yield(self)
10
+ end
11
+
12
+ private
13
+
14
+ def platform
15
+ @platform || DefaultPlatform.default
16
+ end
17
+ end
18
+
19
+ class DefaultPlatform
20
+ def self.register platform
21
+ @default = platform
22
+ end
23
+
24
+ def self.default
25
+ @default or fail 'No platform specified. To set a default, call DefaultPlatform.register'
26
+ end
3
27
  end
@@ -0,0 +1,3 @@
1
+ def features_directory
2
+ File.expand_path('../../../features', __FILE__)
3
+ end
@@ -0,0 +1,3 @@
1
+ module Experience
2
+ VERSION = "0.0.2"
3
+ end
@@ -0,0 +1,22 @@
1
+ require 'rspec'
2
+ require 'experience'
3
+
4
+ describe 'An Experience' do
5
+
6
+ before :all do
7
+ @platform = double('platform')
8
+ Platform.register_default @platform
9
+ end
10
+
11
+ it 'should find content' do
12
+ expect(@platform).to receive(:get_content).with(:id => 'name').and_return('experience')
13
+ class Example
14
+ extend Experience
15
+
16
+ content(:name, :id => 'name')
17
+ end
18
+ Example.read do |example|
19
+ expect(example.name).to eq 'experience'
20
+ end
21
+ end
22
+ end
metadata CHANGED
@@ -1,49 +1,106 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: experience
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.2
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Dane Andersen
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-09-12 00:00:00.000000000 Z
12
- dependencies: []
13
- description: Test applications for the user experience. This is an implementation
14
- of the User Interaction testing pattern.
12
+ date: 2014-10-17 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rspec
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '3.0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '3.0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: cucumber
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: '1.3'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '1.3'
46
+ description: ! 'Test applications for the user experience.
47
+
48
+ This is an implementation of the User Interaction testing pattern.'
15
49
  email:
16
50
  - dane.andersen@gmail.com
17
51
  executables: []
18
52
  extensions: []
19
53
  extra_rdoc_files: []
20
54
  files:
55
+ - .idea/inspectionProfiles/Project_Default.xml
56
+ - .idea/inspectionProfiles/profiles_settings.xml
57
+ - .idea/runConfigurations/test__experience.xml
58
+ - .travis.yml
59
+ - Gemfile
21
60
  - README.md
61
+ - Rakefile
62
+ - cucumber.yml
22
63
  - experience.gemspec
64
+ - features/content.feature
65
+ - features/step_definitions/content_steps.rb
66
+ - features/support/env.rb
67
+ - features/support/stub_data.yml
68
+ - features/support/stub_platform.rb
23
69
  - lib/experience.rb
70
+ - lib/experience/features.rb
71
+ - lib/experience/version.rb
72
+ - spec/experience_spec.rb
24
73
  homepage: https://github.com/daneandersen/experience
25
74
  licenses:
26
75
  - MIT
27
- metadata: {}
28
76
  post_install_message:
29
77
  rdoc_options: []
30
78
  require_paths:
31
79
  - lib
80
+ - features
32
81
  required_ruby_version: !ruby/object:Gem::Requirement
82
+ none: false
33
83
  requirements:
34
- - - '>='
84
+ - - ! '>='
35
85
  - !ruby/object:Gem::Version
36
86
  version: '0'
37
87
  required_rubygems_version: !ruby/object:Gem::Requirement
88
+ none: false
38
89
  requirements:
39
- - - '>='
90
+ - - ! '>='
40
91
  - !ruby/object:Gem::Version
41
92
  version: '0'
42
93
  requirements: []
43
94
  rubyforge_project: experience
44
- rubygems_version: 2.0.14
95
+ rubygems_version: 1.8.28
45
96
  signing_key:
46
- specification_version: 4
97
+ specification_version: 3
47
98
  summary: Test the user experience
48
- test_files: []
99
+ test_files:
100
+ - features/content.feature
101
+ - features/step_definitions/content_steps.rb
102
+ - features/support/env.rb
103
+ - features/support/stub_data.yml
104
+ - features/support/stub_platform.rb
105
+ - spec/experience_spec.rb
49
106
  has_rdoc:
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 1e479cecc36c2dea312fb304f0edbebb778b6672
4
- data.tar.gz: 1f6d91ec9253931b807488557119a462b65291e8
5
- SHA512:
6
- metadata.gz: 992ecfad1b6698a1a6abdec805036c92a082cab0c59410f0ac784e31929561d7951f558c13b5bb99d2915af10ec0d5be9c3d63742f7f7b7e77a4c1d7121a7e00
7
- data.tar.gz: 0b6fbc5ea50f3f239e7b7407976b44146b4a45ce30d24a6a79eebbc5d75dcb70aa972a84143a2a06d522b321cb29d22524f0474bc826723bbe956ab72abef2ee